Hi Carsten,
If you need to add the namespaces manually to some elements before the SOAP response message is processed you can achieve it using the message interceptors that the plug-in provides.
In your case, with the plug-in, are you directly running a SOAP operation? Or you generated a new workflow for that operation and running that workflow? In any case, to use the interceptors you'll need to use a generated workflow. And then, from the scripting box that the workflow has, you have to adapt these lines:
... System.log("invoking '" + operation.name + "' operation..."); var response = operation.invoke(request); System.log("operation '" + operation.name + "' successfully invoked."); ...
to something like:
... System.log("invoking '" + operation.name + "' operation..."); var interceptor = new SOAPInterceptor(); interceptor.setRequestBodyInterceptor(requestBodyHandler); interceptor.setResponseBodyInterceptor(responseBodyHandler); var response = operation.invokeWithInterceptor(request, interceptor); System.log("operation '" + operation.name + "' successfully invoked."); ...
and the to defined those interceptor functions at the end for example:
... function requestBodyHandler(content) { System.log("This is the request body: '" + content + "'"); } function responseBodyHandler(content) { System.log("This is the response body: '" + content + "'"); var doc = XMLManager.fromString(content); // edit the content... return XMLManager.getDocumentContent(doc); }
The first function is useful to edit the request right before sending it, and the second one to process the response immediately after receiving it (and before the plug-in core handles it). Similar functions are available also in case you need to process the header (request or response) instead of the body. You can find some more information in the SOAP Plug-in reference API.
And a couple of inteceptors examples more from the Community:
-
-
I hope it helps.
Sergio