views:

112

answers:

3

I am trying to use a SOAP Web Service provided by a third party. I am having trouble getting the service to work correctly in .NET 3.5. I have added it as a web reference and all seems to go well. Problem is when I call the service all I get returned is a NULL object. I have worked with the provider and there service appears to be working correctly. He did mention:

"We are using Axis2 Document/Literal and support SOAP 1 and 2."

I am not exactly sure what that means as I am a semi-newbie to using Web Services. Do I need to change some configuration parameters or something in .NET to get this service to work correctly?

A: 

Doc/lit (and at least SOAP 1) ought to work with WCF, but I'm not sure how the legacy (pre-.NET 3.0) web service client deals with that.

Did you, in Visual Studio, add a web reference or a service reference? If you added a web reference, you are not using WCF, which may be the reason it's not working. If this is the case, you should delete the web reference and see if adding a service reference instead helps.

Mark Seemann
+1  A: 

From my experience, web service interoperability isn't the magic it claims to be. Especially, between .NET and Java.

  • Axis2 is a Java web service "engine"
  • Document/Literal is a style of writing a WSDL that results in a special SOAP appearance
  • SOAP 1 and 2 (you probably know) the message format and specific versions thereof

all I get returned is a NULL object

Is not much to start with, could you provide more information?

I would recommend, that you try to intercept the exchanged SOAP messages (you can use tcpmon) and check if they are valid. You would probably get an exception if the remote service can't handle your request so I guess your client as some trouble parsing the response. Additionally, you can use soapUI to generate example request to see what a valid request should look like.

wierob
A: 

It sounds like the proxy that you have generated (via add web reference) is not de-serializing the xml into the type you expect.

As wierob suggests the first thing I would do is trace the messages that you send to the service and the response you receive - that way you can examine the xml you can check that the proxy is creating a suitable request message and see whether the response does contain data that is not being de-serialized into the object you expect

As well as tcpmon you could use fiddler (from microsoft) to trace the traffic or the simplest would be to switch on the message tracing in WCF to log the request and response to files which could then you examined in the service trace viewer tool

With these kind of interoperability issues I find the best thing is to look at the message "on the wire" first - you may then have to tweak the wsdl so that the proxy gets generated correctly or hand craft the proxy yourself

If you post the wsdl and your proxy that might give us a clue as to the issues

Richard