Re: .NET based SOAP client inter-op issue with Apache Axis based w





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



Relevant Pages

  • RE: .NET based SOAP client inter-op issue with Apache Axis based web service
    ... I've developed a web service using Apache Axis 1.4 (WSDL shown at the bottom ... as I can tell the SOAP response emitted by Axis looks ok. ...
    (microsoft.public.dotnet.framework.webservices)
  • .NET based SOAP client inter-op issue with Apache Axis based web service
    ... I've developed a web service using Apache Axis 1.4 (WSDL shown at the bottom ... as I can tell the SOAP response emitted by Axis looks ok. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: apachesoap:element issues
    ... This is derived from the WSDL, ... This is a webservices interop sample. ... The service is Apache AXIS v1.1 on ... work around this problem without having to rewrite the web service? ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Problem with WS method returning an array of complex type
    ... Can you change the web service ... > I developped a WS with IBM tools and used the wsdl in Visual Studio> 2003 to add a Web Reference in my client. ... AccountInfo ). ... > Though I got en empty object, when I am calling a method returning an> array of complex type. ...
    (microsoft.public.dotnet.framework)
  • Re: soap + wsdl troubles
    ... >> Once you understand how the web service works, ... > I got the wsdl. ... the array is the sole field of a ComplexType. ... Prev by Date: ...
    (comp.lang.ruby)