I am trying to write server side integration tests of my Spring Web Service Endpoint secured using - Spring WS Security 2.1.2.RELEASE and - WSS4j 1.6.9. I am trying to follow Spring documentation http://static.springsource.org/sprin...ml/server.html. With the setup that I have got so far, I can send a request payload
using MockWebServiceClient asCode:<myns:MyRequest xmlns:myns="..."> ... </myns:MyRequest>
which the integration test properly maps to the endpoint in the test context and I get a "Could not validate request: No WS-Security header found" error as expected.Code:mockWebServiceClient.sendRequest(withPayload(requestPayload)).andExpect(clientOrSenderFault());
Problem: Now the problem here is if I send a request in a SOAP envelope with a security header and body, I would get an endpoint not found exception.
since it will try to find an endpoint around "{http://schemas.xmlsoap.org/soap/envelope/}Envelope".Code:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:myns="..."> <soapenv:Header> ... </soapenv:Header> <soapenv:Body> <myns:MyRequest> ... </myns:MyRequest> </soapenv:Body> </soapenv:Envelope>
Is there a way to work around this problem?


Reply With Quote
