I had the same problem and I was able to find out partly with the @skaffman suggestion.
Basically, I had a custom EndpointInterceptor that I wanted to test using real data so that I knew that everything was correct.
You will need to update spring-ws-test and other spring-ws dependencies to version 2.0 or higher. I ended up using something other than PayloadMessageCreator.
final Source payload = new StreamSource(new StringReader(soapPayload)); SaajSoapMessageFactory saajSoapMessageFactory = new SaajSoapMessageFactory(MessageFactory.newInstance()); WebServiceMessage requestPayload = new SoapEnvelopeMessageCreator(payload).createMessage(saajSoapMessageFactory); MessageContext messageContext = new DefaultMessageContext(requestPayload, saajSoapMessageFactory);
soapPayload is the string value of the entire soap conversion.
Something like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> ...fill in your custom headers here </soapenv:Header> <soapenv:Body><someRequest>...</someRequest></soapenv:Body> </soapenv:Envelope>
You will obviously need to fill out your request payload, any namespaces, as well as your custom headers.
I set the endpoint object to zero because I did not do anything with it as part of my interceptor.
source share