views:

231

answers:

3

I am facing an issue while consuming a java web service from .NET. I am able to provide the input to the web serive but not able to get back the result. The result is a custom object which is created in Java with one long, one short and one string variable. But the output I am getting from .NET is that long and short are always defaulted to 0 and string to null string. Any pointers should be appreciated.

In addition when I make the return as just plain int, it is working fine.

Regards, Bijesh

A: 

Sounds like your WDSL is broken. What created it?

Thorbjørn Ravn Andersen
It was created using RAD 7 with Axis version 1.3 in websphere server
So your WDSL is generated automatically and is completely up to date?
Thorbjørn Ravn Andersen
Yes, it is. But instead of this object if I am using integer return I am getting the return.
A: 

Scott Hanselman just wrote a blog entry dealing with consuming somewhat sloppy wsdl files from an un-named (but likely java based) web service.

His progress though resolving it is likely to apply to your issue so I suggest reading through it and seeing which bits are relevant to your issue.

It is very likely that you will need to modify the wsdl to make the auto generation of your .Net stubs work.

ShuggyCoUk
Thanks. I will be going through the issue. The point here is I am able to get native data types back but just that custom objects are not.
A: 

I'd love to see some WSDL and call samples, but I'll forge ahead making some assumptions about the problem you are having. :) I've had issues in the past with Java and .Net SOAP interoperability. I was using Axis 1.4, by the way.

My particular problem had to do with empty namespaces; e.g., <someElement xmlns="">...</someElement> which means someElement is not part of the namespace of its parent. (More info here.) .Net SOAP clients had -- in the past at least -- trouble with such elements. After some digging I found a workaround on the axis-user mailing list. This worked for us. Perhaps it will help you.

Here are a few other things to try.

  • Switch to WSDL-first development. :)
  • Set the dotNetSoapEncFix parameter to true Axis' .wsdd file. This improves interoperability with .Net regarding arrays.
  • Write some customized serialization code on the Axis side.
JLR