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. 3 3116
"GT" <sm*****@hotmail.com> a écrit dans le message de news: 11*********************@i39g2000cwa.googlegroups.c om... 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.
Can you also post difference between the two WSDL ?
We have encountered a similar problem, that seem related to code generation
from the WSDL.
You can have a look to the generated code too, and see if there is something
wrong.
Rémy
Here is the WSDL (Sorry for the delay): Thoughts?
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://service.axispeople.org"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="https://service.axispeople.org/service/services/ThingService"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="https://service.axispeople.org/service/services/ThingService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://service.axispeople.org">
<s:import namespace="http://schemas.xmlsoap.org/soap/encoding/"
/>
<s:simpleType name="thingNum">
<s:restriction base="s:string">
<s:pattern value="[A-Z0-9]{14}" />
</s:restriction>
</s:simpleType>
<s:simpleType name="valCode">
<s:restriction base="s:string">
<s:pattern value="[ABC]{1}" />
</s:restriction>
</s:simpleType>
<s:simpleType name="amount">
<s:restriction base="s:decimal">
<s:pattern value="[0-9]{1,10}\\.[0-9]{2}" />
</s:restriction>
</s:simpleType>
<s:complexType name="ThingModel">
<s:sequence>
<s:element name="amountOne" nillable="true" type="s0:amount"
/>
<s:element name="amountTwo" nillable="true" type="s0:amount"
/>
<s:element name="amountThree" nillable="true"
type="s0:amount" />
<s:element name="statusCode" nillable="true"
type="s0:valCode" />
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>
<wsdl:message name="getThingRequest">
<wsdl:part name="thingNumber" type="s0:thingNum" />
</wsdl:message>
<wsdl:message name="getThingResponse">
<wsdl:part name="getThingReturn" type="s0:ThingModel" />
</wsdl:message>
<wsdl:portType name="ThingService">
<wsdl:operation name="getThing" parameterOrder="thingNumber">
<wsdl:input name="getThingRequest" message="tns:getThingRequest"
/>
<wsdl:output name="getThingResponse"
message="tns:getThingResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ThingSoapBinding" type="tns:ThingService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc" />
<wsdl:operation name="getThing">
<soap:operation soapAction="" />
<wsdl:input name="getThingRequest">
<soap:body use="encoded"
namespace="http://service.axispeople.org"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output name="getThingResponse">
<soap:body use="encoded"
namespace="https://service.axispeople.org/service/services/ThingService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ThingService">
<wsdl:port name="Thing" binding="tns:ThingSoapBinding">
<soap:address
location="https://service.axispeople.org/service/services/ThingService"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
"GT" <sm*****@hotmail.com> a écrit dans le message de news: 11**********************@e56g2000cwe.googlegroups. com... Here is the WSDL (Sorry for the delay): Thoughts?
....
Somewhat simple WSDL.
I don't see anything, wrong (except that we usually try to avoid the
nillable="true", and replace it with minOccurs="0") but i think that the
problem cannot be there.
Note that Axis can be configured to not send multirefs (in your case, the
SOAP message would be a lot smaller). This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Anand Natrajan |
last post by:
Hi!
I have a VB .NET client that is accessing an rpc/encoded service deployed in Axis 1.2. One of the operations, whoami, returns a string array. The server-side Java signature of this method is...
|
by: Miha Valencic |
last post by:
Hi!
WS is written in java in I am consuming it with .net (v1.1) client.
The problem is in Soap fault exception (below). The program returns
exception:
Unhandled Exception:...
|
by: umhlali |
last post by:
I get the following exception when my VB.NET app calls a Java web service that returns an array of objects. The same call works for a single object though. So looks like there is no problem...
|
by: jennifer.perkins |
last post by:
I've seen a couple posts by people having similar problems, but the
suggested solutions I've tried so far haven't worked.
I'm using a SOAP client in VB.Net (constructed by wsdl.exe) and the...
|
by: Dhananjayan |
last post by:
Hi,
I have a webservice(eg.IStringServicePort) running on Axis, iam able to
create a java client for the same and invoke the service and obtain the
result.
I wanted to create a .Net client(C#)...
| |
by: Dhananjayan |
last post by:
Hi,
I have a java webservice running on Axis, Iam able to create a java client
to invoke the webservice and obtain the result.
But iam not able to invoke the service from .Net client..
Here are...
|
by: David R |
last post by:
This is a repost, with additional information. I have a Net 2.0 client (C#
Winform) calling an Axis web service. The .NET client can authenticate,
create requested objects, serialize the objects...
|
by: andreas.baus |
last post by:
Hi. I created a web service (using Apache Axis) and a client for
accessing it (using .NET 1.1, C# and WSE2.0), and I noticed a strange
phenomenon: When the service sends it's responses using the...
|
by: Martin Hey |
last post by:
I'm consuming an AXIS-webservice. Therefore I got the WSDL.
I added a new web reference to my project pointing to this WSDL.
In Visual Studio I can use all objects the webservice returns and The...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |