views:

711

answers:

1

I have to use a 3rd party web service implemented in .NET 2.0 (on IIS, of course).

I have to make a java client. I am using wsdl2java to generate the SOAP stub.

As the original Apache Axis project now appears unmaintained, and I was having some problems parsing some responses from the service, I converted the client to use the latest (1.5) version of Axis2. Now, the .NET service won't even recognize my requests.

I managed to get the "chunking" turned off (where "stub" is a variable of type MumbleStub generated by wsdl2java, and I am showing what are several lines of code as one horrific line here):

stub._getServiceClient().getOptions().setProperty( HTTPConstants.CHUNKED, Boolean.FALSE);

.. so at least the service recognizes my request AS a request, albeit a bad one: "HTTP/1.1 400 Bad Request" is the response now (as opposed to an "intro / summary" page offering me a link to the WSDL).

I noticed that the Axis ("1") request had a different Content-TYpe header (text/xml, vs application/soap-xml), and I am wondering how to change this request header, if that is in fact the problem.

Alternately, has anybody else had this problem? Is the problem really the (undisplayable here, as it looks like "element injection" to the blog engine) ... xml version-"1.0" ... "XML meta intro tag" that Axis2 added to the beginning of the request?

WS-Deathstar, indeed.

+1  A: 

As you mention the different content-type header I guess your client tries to send SOAP 1.2 requests and the 3rd party app only understands SOAP 1.1

Try changing the used soap version as AFAIK AXIS2 uses SOAP 1.2 by default

stub._getServiceClient().getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
jitter
Well, this looks like THE answer, but I need to do some cleanup (excess log4j drivel) to make sure I have not swapped problems. THANKS!
Roboprog
It now does everything the old Axis client code did, no regressions. Hopefully, Axis2 will solve some of the other problems I was having.
Roboprog
hey if not. just try your luck with another question :)
jitter