Search code examples
javaxmlweb-serviceswebspherejax-ws

JAX-WS empty response in WebSphere but not in Tomcat


I'm developing a simple SOAP JAX-WS WebService.
I'm on JRE 7, so I had to pick quite old libraries because I'll have to deploy on WebSphere 8.5.
I used Spring and CXF.
Testing with soapUI I see the response object is empty on WebSphere and correctly represented in Tomcat 7 (run with a JDK 7), but everything is ok with execution (I can see log trace and DB updated), on both dev an prod environment.
On the other hand, faults (custom complex types too) are represented correctly on both systems.
I tried to change schema between complex type with a sequence of elements or a set of attributes; again, all is ok on Tomcat and response is a well formed XML with correct namespaces but empty on WebSphere.

Here are two response examples:

WebSpehere

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:authResponse xmlns:ns2="http://www.my-ws-domain.com/schema/geco-reply-ws/"/>
   </soap:Body>
</soap:Envelope>

Tomcat

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:authResponse xmlns:ns2="http://www.my-ws-domain.com/schema/geco-reply-ws/">
         <authToken>33WDg36lr+IKUdEMhrfW+L4pg5SzRjtuHtp3kDC5pBE=</authToken>
      </ns2:authResponse>
   </soap:Body>
</soap:Envelope>

I thought it can be JAXB implementation (XML marshallig on WebSphere).
Any suggestions?


Solution

  • It turns out that WebSphere 8.5 has some problems dealing with hash algoritms in javax.crypto package.
    If I respond with a plain text or some Base64 encoding or custom hash function, everything works well.
    If in some part of the call stack, I try to hash a string with crypto functions, no error is shown in WAS console, but hash function returns null.