locked
XML Schema issue when Mapping RRS feed

  • Question

  • Hello ,

     

    We have vendor who has given the schema defination ie. xsd but when I do the mapping with this schema it asks for the root node. I don't understand what's wrong. I asked the vendor to send me the file with the root node and they said they are using the same schemas with other vendors. Here is the schema -- please let me know what should I do. I need the output to this schema in mapping file.

    <?xml version="1.0" encoding="UTF-8" ?>

    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="acknowledge_note">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="address">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="address2" type="xs:string" />

      <xs:element name="billto">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="name" />
            <xs:element ref="address" />
            <xs:element ref="address2" />
            <xs:element ref="city" />
            <xs:element ref="state" />
            <xs:element ref="zip" />
            <xs:element ref="phone" />
            <xs:element ref="fax" />
          </xs:sequence>
          <xs:attribute name="country" type="xs:NMTOKEN" use="required" />
        </xs:complexType>
      </xs:element>

      <xs:element name="buyer">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="name" />
            <xs:element ref="address" />
            <xs:element ref="address2" />
            <xs:element ref="city" />
            <xs:element ref="state" />
            <xs:element ref="zip" />
            <xs:element ref="phone" />
            <xs:element ref="fax" />
          </xs:sequence>
          <xs:attribute name="country" type="xs:NMTOKEN" use="required" />
        </xs:complexType>
      </xs:element>

      <xs:element name="casePack">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="city">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="comment" type="xs:string" />

      <xs:element name="customer">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="customer_ID" type="xs:string" />

      <xs:element name="eaches">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="fax">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="item">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="WFMSKU" />
            <xs:element ref="posDept" />
            <xs:element ref="productName" />
            <xs:element ref="casePack" />
            <xs:element ref="packSize" />
            <xs:element ref="UOM" />
            <xs:element ref="USPrice" />
            <xs:element ref="quantity" />
            <xs:element ref="eaches" />
          </xs:sequence>
          <xs:attribute name="vendorPartNum" type="xs:NMTOKEN" use="required" />
        </xs:complexType>
      </xs:element>

      <xs:element name="items">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="item" maxOccurs="unbounded" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>

      <xs:element name="name">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="packSize">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="phone">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="posDept">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="productName">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="purchaseOrder">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="referenceNumber" />
            <xs:element ref="customer_ID" />
            <xs:element ref="subteamName" />
            <xs:element ref="shipdate" />
            <xs:element ref="shipdateqaulifier" />
            <xs:element ref="vendor" />
            <xs:element ref="billto" />
            <xs:element ref="shipto" />
            <xs:element ref="buyer" />
            <xs:element ref="comment" />
            <xs:element ref="customer" />
            <xs:element ref="acknowledge_note" />
            <xs:element ref="items" />
          </xs:sequence>
          <xs:attribute name="orderDate" type="xs:NMTOKEN" use="required" />
          <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
        </xs:complexType>
      </xs:element>

      <xs:element name="quantity">
        <xs:complexType mixed="true">
          <xs:attribute name="Unit" type="xs:NMTOKEN" use="required" fixed="EA" />
        </xs:complexType>
      </xs:element>

      <xs:element name="referenceNumber">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="shipdate">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="shipdateqaulifier">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="shipto">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="name" />
            <xs:element ref="address" />
            <xs:element ref="address2" />
            <xs:element ref="city" />
            <xs:element ref="state" />
            <xs:element ref="zip" />
            <xs:element ref="phone" />
            <xs:element ref="fax" />
          </xs:sequence>
          <xs:attribute name="country" type="xs:NMTOKEN" use="required" />
        </xs:complexType>
      </xs:element>

      <xs:element name="state">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="subteamName">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="UOM">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="USPrice">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="vendor">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="name" />
            <xs:element ref="address" />
            <xs:element ref="address2" />
            <xs:element ref="city" />
            <xs:element ref="state" />
            <xs:element ref="zip" />
            <xs:element ref="phone" />
          </xs:sequence>
          <xs:attribute name="country" type="xs:NMTOKEN" use="required" />
        </xs:complexType>
      </xs:element>

      <xs:element name="WFMSKU">
        <xs:complexType mixed="true" />
      </xs:element>

      <xs:element name="zip">
        <xs:complexType mixed="true" />
      </xs:element>

    </xs:schema>

     

    Wednesday, July 28, 2010 5:25 PM

Answers

All replies

  • In the gives XSD you are missing such a root node. BizTalk expects all data grouped under a "root" record. This is due to the publish / subscribe mechanism that builds the internal messagetype via Namepace#Rootnodename.

    Your elements are all on root level and so BizTalk isn't able to generate the message type and can't process the message.

     

    Ask your vendor if he is able to group all this elements under a root record.

     

    There are other ways to get the message processed, but this would be the easiest one.


    If you like my post or consider it as a valid answer, please use the buttons to show me - Oliver

    http://biztalk.hauth.me

    Wednesday, July 28, 2010 5:46 PM
  • Hi,

    Please try to set set the 'Root Reference' in the BizTalk schema editor to your root node.  Please see http://social.msdn.microsoft.com/Forums/en/biztalkgeneral/thread/d804ae08-85bb-4db3-b99f-09d4983f5e2c for details.

    Regards,

    Tariq Majeed

     


    Please mark it as answer if it helps
    • Marked as answer by Soneta Wednesday, July 28, 2010 7:07 PM
    Wednesday, July 28, 2010 6:12 PM
  • Having a schema with multiple root elements is perfectly valid and BizTalk is easily able to work with this.

    When you have multiple root elements in the schema, each root element will be deployed as a MessageType and you can create a message using any of the root elements.
    If you specify the 'Root Reference' then only this element is deployed as a MessageType and you can only create a message with this root node.

    Without the 'Root Reference' when you use this schema to create a map it will prompt you to specify the root element, just select the one you want, e.g purchaseOrder.

    In this instance it may be perfectly valid to use the Root Reference, but in other cases this may not be so. One advantage of specifying a Root Reference is reducing the number of deployed MessageTypes, i.e. less clutter.

     

     

    • Proposed as answer by Tariq Majeed Thursday, July 29, 2010 2:05 AM
    Thursday, July 29, 2010 1:47 AM
    Answerer