Envelope Schema

Home Page Forums BizTalk 2004 – BizTalk 2010 Envelope Schema

Viewing 1 reply thread
  • Author
    Posts
    • #22049

      Hi,

      I have created an evelope schema and a content schema.

      Envelope Schema:

       <?xml version=”1.0″ encoding=”utf-16″ ?>

      <xs:annotation>
      <xs:appinfo>
        <b:schemaInfo is_envelope=”yes />
        </xs:appinfo>
        </xs:annotation>
      <xs:element name=”EnvelopeError>
      <xs:annotation>
      <xs:appinfo>
        <b:recordInfo body_xpath=”/*[local-name()=’EnvelopeError’ and namespace-uri()=’http://BasicXMLEnvelope’%5D/*%5Blocal-name()=’Error&#8217; and namespace-uri()=”] />
        </xs:appinfo>
        </xs:annotation>
      <xs:complexType>
      <xs:sequence>
        <xs:element name=”BatchID type=”xs:int />
      <xs:element name=”Error>
      <xs:complexType>
      <xs:sequence>
        <xs:any />
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:schema>

       

      Content chema:
       <?xml version=”1.0″ encoding=”utf-16″ ?>

      <xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003 xmlns=”http://BasicXMLEnvelope elementFormDefault=”qualified targetNamespace=”http://BasicXMLEnvelope xmlns:xs=”http://www.w3.org/2001/XMLSchema>
      <xs:element name=”Error>
      <xs:complexType>
      <xs:sequence>
        <xs:element name=”ID type=”xs:integer />
        <xs:element name=”Type type=”xs:integer />
        <xs:element name=”Priority type=”xs:string />
        <xs:element name=”Description type=”xs:string />
        <xs:element name=”TimeStamp type=”xs:dateTime />
        </xs:sequence>
        </xs:complexType>
        </xs:element>
        </xs:schema>
       
      Now If i create a sample batch xml , it always return error during instance validation. I know i must be missing something very basic to it but I am not able to find what?
       
      Sample XML:

      <

       

      ns0:EnvelopeError xmlns:ns0=http://BasicXMLEnvelope>

      <

       

      BatchID>10</BatchID>

       

       

      <Error>

      <

       

      ID>100</ID>

      <

       

      Type>100</Type>

      <

       

      Priority>Priority_0</Priority>

      <

       

      Description>Description_0</Description>

      <

       

      TimeStamp>1999-05-31T13:20:00.000-05:00</TimeStamp>

      </

       

      Error>

      </

       

      ns0:EnvelopeError>

      Error:

       

      error BEC2004: The ‘ID’ element is not declared.

      error BEC2004: The element ‘Error’ has invalid child element ‘Type’

       

      Thanks in advance.

    • #22055

      Open your envelope schema and select the <Any> element. Set MaxOccurs = Unbounded and Process Contents = Skip

      • #22056

        Looking at the schemas further, you will have problems when debatching the message in the pipeline as the content schema will not match the debatched message.

        There are a number of problems.

        Firstly the Body Xpath definition in the schema points to the Error node. So the XmlDisassembler will debatch each child node of this node. i.e. you will get 5 messages ( ID, Type, Priority, Description and Timestamp). Your content schema does not define any of these messages.

        The namespaces are not correct. The envelope schema ElementFormDefault is set to Unqualified (the default) so only the root node has a namespace. While the content schema has the same namespace and ElementFormDefault is set to Qualified

        <?xml version=1.0 encoding=utf-16?>
        <
        xs:schema xmlns:b=http://schemas.microsoft.com/BizTalk/2003 xmlns=http://BasicError elementFormDefault=qualified targetNamespace=http://BasicError xmlns:xs=http://www.w3.org/2001/XMLSchema>
        <
        xs:element name=Error>
        <
        xs:complexType>
        <
        xs:sequence>
        <
        xs:element name=ID type=xs:integer />
        <
        xs:element name=Type type=xs:integer />
        <
        xs:element name=Priority type=xs:string />
        <
        xs:element name=Description type=xs:string />
        <
        xs:element name=TimeStamp type=xs:dateTime />
        </
        xs:sequence>
        </
        xs:complexType>
        </
        xs:element>
        </
        xs:schema>

         

         

        And a sample message:
        <ErrorEnvelope xmlns=http://BasicXMLEnvelope BatchID=10>
        <
        Error xmlns=http://BasicError>
        <
        ID>100</ID>
        <
        Type>100</Type>
        <
        Priority>Priority_0</Priority>
        <
        Description>Description_0</Description>
        <
        TimeStamp>1999-05-31T13:20:00.000-05:00</TimeStamp>
        </
        Error>
        </
        ErrorEnvelope>

         

        • #22063

          Thank ou very much. I do not have much understanding about XML namespaces and structure. Will tryo to refer some good study meaterial.If you can suggest any, I would be more then happy.

          But really appreciate your input.

          Thank you once again

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.