1

I created a handler to change the namespace of the genrated soap envelope, but when i send the message, i have the feeling that, the old enveloppe is sent.

Below the code of the handler:

 @Override
    public boolean handleMessage(SOAPMessageContext soapMessageContext) {
        Boolean isOutBound = (Boolean) soapMessageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)
        try {
            if (isOutBound) {
                def message = soapMessageContext.getMessage()
                message.getSOAPBody().removeNamespaceDeclaration("S")
                message.getSOAPPart().getEnvelope().removeNamespaceDeclaration("S")
                message.getSOAPPart().getEnvelope().setPrefix("c")
                message.getSOAPBody().setPrefix("c")
                message.saveChanges()
            }
            return true
        } catch (SOAPException e) {
            e.getMessage()
            return false
        }
    }

thank u in adavance for the help

0 Answers0