0

I have a web service where the customer sends the http header with the SOAP action with single quotes (...;action='myServiceOp'). We used traditional Websphere application server 8, but migrated to Websphere Liberty. Now Liberty does not like this single quotes and responds with

The given SOAPAction 'myServiceOp' does not match an operation.

So I thought I use a handler to modify this parameter and did the following in the handleMessage method:

Map<String, List<String>> requestHeaders = (Map<String, List<String>>) ctx.get(MessageContext.HTTP_REQUEST_HEADERS);
if(requestHeaders.get("Content-Type") != null) {
    List<String> cleanedContentType =  requestHeaders.get("Content-Type");
    String cleanedString = requestHeaders.get("Content-Type").get(0).replace("'", "");
    cleanedContentType.clear();
    cleanedContentType.add(cleanedString);
    requestHeaders.put("Content-Type", cleanedContentType);         
}

In my logs I can see that the request headers were set accordingly, but my web service still answers with the above error.

Liberty uses CXF and we had already a lot of issues with that, so I suspect that this is somehow interfering.

Is there maybe a Liberty configuration in the server.xml?

If an interceptor is needed (or something CXF specific), do I need an extra feature? Because I get ClassNotFound errors when I tried that the last time.

Kind regards

Andy Guibert
  • 41,446
  • 8
  • 38
  • 61
kinglite
  • 339
  • 3
  • 20
  • You need to modify the `SOAPAction` HTTP header , not the `Content-Type` header. The Content-Type header should just state `Content-Type: text/xml charset="utf-8"` for a SOAP request, that's not the one you need to modify. – nos Sep 10 '18 at 14:53
  • As far as I know the SOAPaction header is deprecated – kinglite Sep 11 '18 at 11:40

0 Answers0