472,789 Members | 1,299 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

Dotnet Client fails to deserialize message from AXIS web service if the message maps two elements to the same multiRef element. What do I do?

GT
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.

Mar 21 '06 #1
3 3063

"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
Mar 21 '06 #2
GT
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>

Mar 30 '06 #3

"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).

Mar 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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...
0
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:...
0
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...
0
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...
0
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#)...
3
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...
11
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...
0
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...
1
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.