Re: .NET based SOAP client inter-op issue with Apache Axis based w
- From: Tony Stephens <TonyStephens@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 2 Aug 2007 05:56:04 -0700
"John Saunders [MVP]" wrote:
"Tony Stephens" <tony.stephens@xxxxxxxxxxxxxx> wrote in message
news:M_Cdnc6TW-Y9Qy3bRVnyuwA@xxxxxxxxx
Hi,
I've developed a web service using Apache Axis 1.4 (WSDL shown at the
bottom of this post) which is deployed to Apache Tomcat 5.5. Using
VisualStudio.NET 2003 I've created a small .NET (1.1) based test client to
invoke one of the methods. I get the following exception thrown by the
client when I invoke the loginUser method on the web service:
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.xml.dll
Additional information: There is an error in XML document (1, 2457).
Unhandled Exception: System.InvalidOperationException: There is an error
in XML document (1, 2457). ---> System.InvalidCastException: Cannot assign
object of type
VIPerProvisionTest.provision.ServiceDescriptor to an object of type
VIPerProvisionTest.provision.ServiceDescriptor[].
This means that it thinks it has encountered a single ServiceDescriptor in
the input, but needs to cast it to an array (which makes sense given the
maxOccurs).
....
The problem seems to be with the ServiceList element. I've tried just
defining a ServiceDescriptor array in the WSDL (without the ServiceList
wrapper) but I get the same exception thrown. If I remove the ServiceList
from the definition of Organisation, or I change ServiceList for just a
single ServiceDescriptor, then the method invocation is successful. As far
as I can tell the SOAP response (shown below) emitted by Axis looks ok.
Actually, it doesn't look like a SOAP-encoded response at all. It looks
literal. I never use RPC/Encoded, so I can't tell you for sure, but I think
the XML is supposed to say "there's an array here". Instead, it says there's
a ServiceDescriptor.
Does a Java client consume this service ok?
--
John Saunders [MVP]
Hi John,
Thanks for your response. I'm aware of what the exception is stating. My
implied question is given that the WSDL specifies that there is an array in
the response why is the .NET proxy unable to interpret the list of service
descriptors as an array (why does there need to be an explicit indicator of
an array) ? Is there some means of tweaking the proxy behaviour ? I haven't
been able to find a way to force apache axis to wrap this list (i.e. have a
<serviceDescriptors> container which presumably is why .NET is complaining ?)
I would have thought that this is a common problem (getting a .NET client
working to an apache axis service) and so someone somewhere must have gone
down this path before, discovered the same problem, and possibly been able to
resolve this either by tweaking the .NET proxy generated code, the WSDL, or
the java tool that generates the web service.
I have a java based client that is able to communicate correctly with the
web service.
Thanks,
Tony
.
- References:
- .NET based SOAP client inter-op issue with Apache Axis based web service
- From: Tony Stephens
- Re: .NET based SOAP client inter-op issue with Apache Axis based web service
- From: John Saunders [MVP]
- .NET based SOAP client inter-op issue with Apache Axis based web service
- Prev by Date: Re: How to avoid first time exceptions when calling a webmethod ?
- Next by Date: Re: How to avoid first time exceptions when calling a webmethod ?
- Previous by thread: Re: .NET based SOAP client inter-op issue with Apache Axis based web service
- Next by thread: RE: .NET based SOAP client inter-op issue with Apache Axis based web service
- Index(es):
Relevant Pages
|