Converting a BizTalk Document to a C Class

Converting a BizTalk Document to a C# Class

For every document that is passed to an XML Web service, you need to create a corresponding C# class. The following steps illustrate this process:

  1. On the Start menu, point to Programs, point to Microsoft BizTalk Server 2002, and then click BizTalk Editor.
  2. On the File menu, click Retrieve from WebDAV.

    The Retrieve from WebDAV dialog box appears.

  3. Browse for an XML document schema, and then click Open.
  4. On the Tools menu, click Export XSD Schema.

    The Export XSD Schema dialog box appears.

  5. Type a name for the XSD file in the File name box, and then click Save.
  6. Close BizTalk Editor.
  7. On the Start menu, point to Programs, point to Microsoft Visual Studio .NET, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.

    The Visual Studio .NET Command Prompt window appears.

  8. Run the XSD program to create a C# class from the XSD file you created previously by typing:

    XSD filename.xsd /c

    This command creates a new C# class named filename.cs.

  9. Edit this C# class file to add a namespace declaration. For example:
    namespace namespacename { <contents of file> } 
  10. Update the XML element information.

    For example, using the following output:

    /// <remarks/> [System.Xml.Serialization.XmlRootAttribute("Seller", Namespace="", IsNullable=false)] public class Seller {          /// <remarks/>     [System.Xml.Serialization.XmlElementAttribute("Address", typeof(Address))]     [System.Xml.Serialization.XmlElementAttribute("ContactInfo", typeof(ContactInfo))]     public object[] Items; } 
Previous  Next


Microsoft Corporation - Microsoft. Net Server Solutions for the Enterprise
Microsoft .NET Server Solutions for the Enterprise
ISBN: 0735615691
EAN: 2147483647
Year: 2002
Pages: 483

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net