I use SimpleWebServiceInboundGateway for handling SOAP requests.
Here is a piece of my code:
@Router(defaultOutputChannel = "unsupportedOperation", inputChannel = "wsRequestChannel")
public String route(Message message) {
String soapAction = (String)message.getHeaders().get(WS_SOAP_ACTION);
...
}
@Bean
public SimpleWebServiceInboundGateway wsInboundGateway(){
SimpleWebServiceInboundGateway simpleWebServiceInboundGateway = new SimpleWebServiceInboundGateway();
simpleWebServiceInboundGateway.setRequestChannelName("wsRequestChannel");
simpleWebServiceInboundGateway.setReplyChannelName("wsResponseChannel");
simpleWebServiceInboundGateway.setErrorChannelName("wsErrorChannel");
return simpleWebServiceInboundGateway;
}
The incoming soap envelope contains a soap header:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
<soapenv:Header>
<myAuth>
<username>user</username>
<password>pass</password>
</myAuth>
</soapenv:Header>
<soapenv:Body>
...
The Message object in my router does not contains the header data. How can I extract the username and the password?