I have received below response in Java Spring Boot ws application:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header>
<dateTime>23082020033057</dateTime>
</soapenv:Header>
<soapenv:Body>
<TestResponse>
<ResponseCode>06</ResponseCode>
</TestResponse>
</soapenv:Body>
</soapenv:Envelope>
I'm parsing response in SOAPHandler class.
public class HeaderHandler implements SOAPHandler<SOAPMessageContext> {
private static final String SOAP_ENV_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";
private static final String PREFERRED_PREFIX = "soapenv";
public boolean handleMessage(SOAPMessageContext smc) {
SOAPMessage message = smc.getMessage();
}
}
I received below error message.
**javax.xml.ws.WebServiceException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: HeaderElements must be namespace qualified**