I have a .NET client that consumes an Axis web service. A change was
made recently to the AXIS web service, and ever since then my .NET
proxy class has been throwing an InvalidCastException. The proxy class
was auto-generated by Visual Studio from WSDL provided by people who
provide the Axis service, and I have not modified it (except to add
code for a build that includes a SOAP trace). The only difference I
see in the messages is that in the latest version of the Axis service,
two elements refer to the same multiRef element, as in the example
below
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getThingResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://thingservice.axispeople.org">
<getThingReturn href="#id0" />
</ns1:getThingResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Thing"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn:Thing">
<amountOne href="#id1" />
<amountTwo href="#id1" />
<amountThree href="#id2" />
<statusCode xsi:type="soapenc:string">O</statusCode>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">28890</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Previous versions of this message looked like this:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getThingResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://thingservice.axispeople.org">
<getThingReturn href="#id0" />
</ns1:getThingResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Thing"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="urn:Thing">
<amountOne href="#id1" />
<amountTwo href="#id2" />
<amountThree href="#id3" />
<statusCode xsi:type="soapenc:string">O</statusCode>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
<multiRef id="id2" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
<multiRef id="id3" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:decimal"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">28890</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Is it valid to have two elements map to the same multiRef element in a
SOAP response? If so, how do I modify the deserialization behavior to
handle it?
I suspect that the deserializer thingy is using a forward-only stream
so it blows up if it has to read an element twice. Am I on the right
track here?
Any insight is greatly appreciated.