none
Response from a SOAP system is formated strange (or is to me). RRS feed

  • Question

  • Using Biztalk 2009 I am making a request of an external system that is using SOAP as the interface.  I have done the WSDL at one point and gotten back the information to build, so I built my send and receive schema's.  The send works fine and I do get response back but it appears the other system is sending me the schema and then the actual data, when all I want is the actual data.  Below is an example of the response I get back.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <VehicleByVinLicResponse xmlns="https://xxxxx/xxxxx/PropertyVehicleServices">
             <VehicleByVinLicResult>
                <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                   <xs:element name="NewDataSet" msdata:IsDataSet="true">
                      <xs:complexType>
                         <xs:choice maxOccurs="unbounded">
                            <xs:element name="Table">
                               <xs:complexType>
                                  <xs:sequence>
                                     <xs:element name="DeleteCode" type="xs:string" minOccurs="0"/>
                                     <xs:element name="VehicleOwnershipData" type="xs:string" minOccurs="0"/>
                                     <xs:element name="Filler2" type="xs:string" minOccurs="0"/>
                                     <xs:element name="OcaNumber" type="xs:int" minOccurs="0"/>
                                  </xs:sequence>
                               </xs:complexType>
                            </xs:element>
                         </xs:choice>
                      </xs:complexType>
                   </xs:element>
                </xs:schema>
                <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
                   <NewDataSet xmlns="">
                      <Table diffgr:id="Table1" msdata:rowOrder="0">
                         <DeleteCode></DeleteCode>
                         <OcaNumber>CR0812345</OcaNumber>
                       
                      </Table>
                   </NewDataSet>
                </diffgr:diffgram>
             </VehicleByVinLicResult>
          </VehicleByVinLicResponse>
       </soap:Body>
    </soap:Envelope>

    My Response schema looks like this.

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:tns="https://xxxxx/xxxxx/PropertyVehicleServices" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" elementFormDefault="qualified" targetNamespace="https://xxxxx/xxxxx/PropertyVehicleServices" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="VehicleByVinLicResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="wsToken" type="xs:string" />
            <xs:element name="DeleteCode" type="xs:string" />
            <xs:element name="OcaNumber" type="xs:string" />
          
          </xs:sequence>
        </xs:complexType>
     </xs:element>
        </xs:schema>
      </xs:element>
    </xs:schema>

    Suggestions????   As I said I get response, but all I get is the schema from the top and not the actual data in the fields.

    Thanks

    Karl

     

     

    Friday, April 1, 2011 11:26 PM

Answers

  • OK, I have four schemas from that message, sorry...

    Schema 0 (main):

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="https://xxxxx/xxxxx/PropertyVehicleServices" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile11.xsd" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" />
      <xs:element name="VehicleByVinLicResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="VehicleByVinLicResult">
              <xs:complexType>
                <xs:sequence>
                  <xs:element ref="diffgr:diffgram" />
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    Schema 1 (in my called called XMLFile11.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:tns="urn:schemas-microsoft-com:xml-diffgram-v1" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile12.xsd" />
      <xs:element name="diffgram">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="NewDataSet" />
          </xs:sequence>
          <xs:attribute name="id" type="xs:string" use="required" />
        </xs:complexType>
      </xs:element>
      <xs:attribute name="id" type="xs:string" />
    </xs:schema>

    Schema 2 (XMLFile12.xsd)

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile11.xsd" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" />
      <xs:import schemaLocation=".\XMLFile13.xsd" namespace="urn:schemas-microsoft-com:xml-msdata" />
      <xs:element name="NewDataSet">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Table">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="DeleteCode" />
                  <xs:element name="VehicleOwnershipData" />
                  <xs:element name="Filler2" />
                  <xs:element name="OcaNumber" type="xs:string" />
                </xs:sequence>
                <xs:attribute xmlns:q1="urn:schemas-microsoft-com:xml-diffgram-v1" ref="q1:id" use="required" />
                <xs:attribute xmlns:q2="urn:schemas-microsoft-com:xml-msdata" ref="q2:rowOrder" use="required" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

     

    Schema 3 - XMLFile13.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:tns="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:attribute name="rowOrder" type="xs:unsignedByte" />
    </xs:schema>

    The Add Generated Items wizard made all these schemas out of your first XML after replacing the <xs:schema> tags and eveything between them. 

    This WILL validate and will work.  Please mark as answer when it does.

    Kind Regards,

    -Dan


    If this answers your question, please Mark
    Monday, April 4, 2011 9:08 PM

All replies

  • Hi Karl,

    So what's the issue caused by the schema?  It is definitely something on the service side and you may not be able to make it stop, but there is data in the bottom part of it.  If Do you mean the data doesn't flow into your response message inside BizTalk?  It looks like it wont because that diffgram isn't in your schema.  If worse comes to worse take the response message (inside the SOAP envelope) and use the Generate Schemas (Well Formed XML) feature in Visual Studio to create the new schema to receive the response in.  Then use this new schema. 

    Kind Regards,

    -Dan

    Saturday, April 2, 2011 8:18 PM
  • Dan,

    I do get data in my response, but it is the schema definition at the top, not the data at the borttom (which is what I need).   I tried your suggestion and copied the data from the response into a new file and tried to use the 'generate schema' (well formed xml)

    Normal User-defined incomplete Error parsing WFX:The supplied xml instance is a schema or contains an inline schema. This class cannot infer a schema for a schema.

    is the response I received.  Below is what I save to the file for the generate schema.

     

    <VehicleByVinLicResponse xmlns="https://xxxxx/xxxxx/PropertyVehicleServices">
             <VehicleByVinLicResult>
                <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                   <xs:element name="NewDataSet" msdata:IsDataSet="true">
                      <xs:complexType>
                         <xs:choice maxOccurs="unbounded">
                            <xs:element name="Table">
                               <xs:complexType>
                                  <xs:sequence>
                                     <xs:element name="DeleteCode" type="xs:string" minOccurs="0"/>
                                     <xs:element name="VehicleOwnershipData" type="xs:string" minOccurs="0"/>
                                     <xs:element name="Filler2" type="xs:string" minOccurs="0"/>
                                     <xs:element name="OcaNumber" type="xs:int" minOccurs="0"/>
                                  </xs:sequence>
                               </xs:complexType>
                            </xs:element>
                         </xs:choice>
                      </xs:complexType>
                   </xs:element>
                </xs:schema>
                <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
                   <NewDataSet xmlns="">
                      <Table diffgr:id="Table1" msdata:rowOrder="0">
                      </Table>
                   </NewDataSet>
                </diffgr:diffgram>
             </VehicleByVinLicResult>
          </VehicleByVinLicResponse>

    Monday, April 4, 2011 1:35 PM
  • We'll ignore why exposing dataset is a hassle, but I think this will work.  To create this I just cut the schema out of the XML above and used Add Generated items (well formed XML).  Pleast let me know if this does work and do note the namespace in the targetNamespace.

    Kind Regards,

    -Dan

     

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="https://xxxxx/xxxxx/PropertyVehicleServices" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile11.xsd" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" />
      <xs:element name="VehicleByVinLicResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="VehicleByVinLicResult">
              <xs:complexType>
                <xs:sequence>
                  <xs:element ref="diffgr:diffgram" />
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    Monday, April 4, 2011 2:02 PM
  • Dan,

     

    Thanks for the quick response, I copied the above into a text file and saved it as a unicode file with an xml extension.  I modified the targetnamespace to match my value and I still get the following error when using bizyalk 2009 to add generated item well formed xml.

    Normal User-defined incomplete Error parsing WFX:The supplied xml instance is a schema or contains an inline schema. This class cannot infer a schema for a schema.

    Karl

    Monday, April 4, 2011 5:40 PM
  • Hi Karl,

    What I posted is the XSD, not the XML.  Just save it in a file, rename to .xsd and add it as an existing item.  It is the schema you want to use.

    Kind Regards,


    -Dan Rosanova If this answers your question, please Mark as Answer
    Monday, April 4, 2011 6:29 PM
  • Dan,

    Ok, I did that and when I try to open the schema in Biztalk I get this error

    The 'urn:schemas-microsoft-com:xml-diffgram-v1:diffgram' element is not declared.

    It then goes ahead and opens, but I am afraid my app will not deploy with this error, as I know I can not validate the schema right now.

     

    Thanks

     

    Monday, April 4, 2011 7:26 PM
  • OK, I have four schemas from that message, sorry...

    Schema 0 (main):

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="https://xxxxx/xxxxx/PropertyVehicleServices" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile11.xsd" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" />
      <xs:element name="VehicleByVinLicResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="VehicleByVinLicResult">
              <xs:complexType>
                <xs:sequence>
                  <xs:element ref="diffgr:diffgram" />
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

    Schema 1 (in my called called XMLFile11.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:tns="urn:schemas-microsoft-com:xml-diffgram-v1" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile12.xsd" />
      <xs:element name="diffgram">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="NewDataSet" />
          </xs:sequence>
          <xs:attribute name="id" type="xs:string" use="required" />
        </xs:complexType>
      </xs:element>
      <xs:attribute name="id" type="xs:string" />
    </xs:schema>

    Schema 2 (XMLFile12.xsd)

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import schemaLocation=".\XMLFile11.xsd" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" />
      <xs:import schemaLocation=".\XMLFile13.xsd" namespace="urn:schemas-microsoft-com:xml-msdata" />
      <xs:element name="NewDataSet">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Table">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="DeleteCode" />
                  <xs:element name="VehicleOwnershipData" />
                  <xs:element name="Filler2" />
                  <xs:element name="OcaNumber" type="xs:string" />
                </xs:sequence>
                <xs:attribute xmlns:q1="urn:schemas-microsoft-com:xml-diffgram-v1" ref="q1:id" use="required" />
                <xs:attribute xmlns:q2="urn:schemas-microsoft-com:xml-msdata" ref="q2:rowOrder" use="required" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

     

    Schema 3 - XMLFile13.xsd

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:tns="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:attribute name="rowOrder" type="xs:unsignedByte" />
    </xs:schema>

    The Add Generated Items wizard made all these schemas out of your first XML after replacing the <xs:schema> tags and eveything between them. 

    This WILL validate and will work.  Please mark as answer when it does.

    Kind Regards,

    -Dan


    If this answers your question, please Mark
    Monday, April 4, 2011 9:08 PM
  • Thanks Andrew for marking this a ANSWERED.... 

    I was able to get this working late yesterday afternoon...  Thanks Dan!!!  I find it interesting that the generate schema creates the 4 schema files and links them all together.

     

    Karl

     

    Friday, April 8, 2011 12:49 PM