Hi,
I seem to be having some problems connecting to webservices. I'm running a
C# client connected to a Java webservice using GLUE.
The difference between the two request and response pairs below is the first
contains one item in the request and the second contains two.
From what I can see, the only real difference between the two involves the
following:
<status>
<code>1</code>
<description>Added</description>
</status>
When I make a request with multiple items, the SOAP document that is
returned from GLUE does some optimization that seems to be causing problems
with the .NET deserializer.
If items in the document contain the exact same status, a reference is
inserted into the document:
<status href="#id3" soapenc:root="0"/>
and references the following later in the document:
<id3 id="id3"> <code>1</code>
<description>Added</description>
</id3>
When the document is deserialized, I get the following error (the class
ResponseState maps to 'status' in the XML document).
Message "Cannot assign object of type System.Xml.XmlNode[] to an object of
type Homebase.InventoryService.ResponseState."
StackTrace " at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.fixup_Read1_ListingUpdateResul t(Object
objFixup)\r\n at
System.Xml.Serialization.XmlSerializationReader.Do Fixups()\r\n at
System.Xml.Serialization.XmlSerializationReader.Re adReferencedElements()\r\n
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read20_updateListingsResponse( )"
string
Assuming that this is the problem, is there a setting of some sort that I
can change to ensure that the document is process correctly? Can you see
another problem?
Thanks in advance,
Chris
*Valid Request*
=====================================
REQUEST:
=========================
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:updateListings
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="x">
<ns2:arg0
xmlns="http://www.webmethods.com/package/com.abe.bedrock.token/"
xmlns:ns2="http://www.webmethods.com/package/com.abe.bedrock.token/"
xsi:type="ns2:Token">
<applicationKey xmlns=""
xsi:type="xsd:string">HomeBase</applicationKey>
<userKey
xmlns=""
xsi:type="xsd:string">357B020720D925056E09375400F1 9BBD31408B05</userKey>
</ns2:arg0>
<arg1
SOAP-ENC:arrayType="ns3:BookListing[1]"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns3="http://www.webmethods.com/package/com.abe.bedrock.dto/"
xsi:type="SOAP-ENC:Array">
<i>
<author>JIMBob Whoever</author>
<binding>36</binding>
<edition>-1</edition>
<ISBN/>
<languageISOCode3>eng</languageISOCode3>
<printing>-1</printing>
<productType>1</productType>
<publisherCity>Hill</publisherCity>
<publisherCountry>CAN</publisherCountry>
<publisherName>Abe Books</publisherName>
<publisherYear>2005</publisherYear>
<title>SomeTitle</title>
<itemCondition>5</itemCondition>
<jacketCondition>-1</jacketCondition>
<price>19.99</price>
<quantity>1</quantity>
<quantityHeld>0</quantityHeld>
<quantityLimit>0</quantityLimit>
<shippingMultiplier>0</shippingMultiplier>
<signatureType>-1</signatureType>
<vendorCatalogID>0</vendorCatalogID>
<vendorListingID>1237877</vendorListingID>
</i>
</arg1>
</ns1:updateListings>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
RESPONSE:
===========================
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:n2="http://www.webmethods.com/package/com.abe.bedrock.service.inventory.response/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <n:updateListingsResponse xmlns:n="x"> <Result> <responseMessage>Success</responseMessage> <timestamp>2006-01-30T21:45:11.090Z</timestamp> <resultMessages soapenc:arrayType="n2:ListingUpdateResult[1]"> <i> <lastUpdated>2006-01-30T21:45:11.164Z</lastUpdated> <listingID>592503601</listingID> <status> <code>1</code> <description>Added</description> </status> <vendorListingID>1237877</vendorListingID> </i> </resultMessages> </Result> </n:updateListingsResponse> </soap:Body></soap:Envelope>*Invalid Request*===================================== REQUEST:=========================<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <ns1:updateListingsSOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"xmlns:ns1="x"> <ns2:arg0 xsi:type="ns2:Token"xmlns="http://www.webmethods.com/package/com.abe.bedrock.token/"xmlns:ns2="http://www.webmethods.com/package/com.abe.bedrock.token/"> <applicationKey xsi:type="xsd:string" xmlns="">HomeBase</applicationKey> <userKey xsi:type="xsd:string"xmlns="">357B020720D925056E09 375400F19BBD31408B05</userKey> </ns2:arg0> <arg1 xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ns3:BookListing[2]"xmlns:ns3="http://www.webmethods.com/package/com.abe.bedrock.dto/"xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <i> <author>JIMBob Whoever</author> <binding>36</binding> <edition>-1</edition> <ISBN></ISBN> <languageISOCode3>eng</languageISOCode3> <printing>-1</printing> <productType>1</productType> <publisherCity>Hill</publisherCity> <publisherCountry>CAN</publisherCountry> <publisherName>Abe Books</publisherName> <publisherYear>2005</publisherYear> <title>SomeTitle</title> <itemCondition>5</itemCondition> <jacketCondition>-1</jacketCondition> <price>25.99</price> <quantity>1</quantity> <quantityHeld>0</quantityHeld> <quantityLimit>0</quantityLimit> <shippingMultiplier>0</shippingMultiplier> <signatureType>-1</signatureType> <vendorCatalogID>0</vendorCatalogID> <vendorListingID>1237898</vendorListingID> </i> <i> <author>Edgerton, Clyde</author> <binding>36</binding> <edition>-1</edition> <ISBN>094557553X</ISBN> <languageISOCode3>eng</languageISOCode3> <printing>-1</printing> <productType>1</productType> <publisherCity>Chapel Hill</publisherCity> <publisherCountry>USA</publisherCountry> <publisherName>Algonquin Books</publisherName> <publisherYear>1991</publisherYear> <title>Killer Diller</title> <itemCondition>5</itemCondition> <jacketCondition>-1</jacketCondition> <price>13.99</price> <quantity>1</quantity> <quantityHeld>0</quantityHeld> <quantityLimit>0</quantityLimit> <shippingMultiplier>0</shippingMultiplier> <signatureType>-1</signatureType> <vendorCatalogID>0</vendorCatalogID> <vendorListingID>1237897</vendorListingID> </i> </arg1> </ns1:updateListings> </SOAP-ENV:Body></SOAP-ENV:Envelope>RESPONSE:===========================< ?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:n2="http://www.webmethods.com/package/com.abe.bedrock.service.inventory.response/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <n:updateListingsResponse xmlns:n="x"> <Result> <responseMessage>Success</responseMessage> <timestamp>2006-01-30T21:37:59.585Z</timestamp> <resultMessages soapenc:arrayType="n2:ListingUpdateResult[2]"> <i> <lastUpdated>2006-01-30T21:38:01.775Z</lastUpdated> <listingID>592503598</listingID> <status href="#id3" soapenc:root="0"/> <vendorListingID>1237898</vendorListingID> </i> <i> <lastUpdated>2006-01-30T21:38:01.880Z</lastUpdated> <listingID>592503599</listingID> <status href="#id3"/> <vendorListingID>1237897</vendorListingID> </i> </resultMessages> </Result> </n:updateListingsResponse> <id3 id="id3"> <code>1</code> <description>Added</description> </id3> </soap:Body></soap:Envelope>