January 30, 2011 by huionn
I thought web service is supposed to be easily interoperable between . net and Java. But I guess my assumption is wrong, at least for optional elements and array type parameter.
I encountered a problem when I first tried with Oracle JDeveloper web service client.
Then I tried with Apache Axis 1.4. It works by default. However the default generated skeleton does not handle optional elements properly:
<s:element minOccurs=”0” maxOccurs=”1” name=”SearchResult” type=”tns:ArrayOfDataResult” />
So, I have to use –noWrapped http://axis.apache.org/axis/java/reference.html. Unfortunately, it has a negative side effect – now the SOAP request failed with .net web service server. I am not sure which party is at fault.
By using Membrane SOAP Monitor (a handy SOAP troubleshooting tool), I found that the new SOAP request did not have xsi:type=”xsd:string” in request parameters.
After some debugging with the Axis source, the solution is easy – modifying _call.setProperty(“sendXsiTypes”,
Boolean.FALSEBoolean.TRUE); in the generated web service interface.
I would say that the open source make the troubleshooting much simpler.