Kobrakai
11 years agoOccasional Visitor
Whitespace in signed SOAP/HTTP request causes SOAP fault
I have a Java service running on JBoss, using Apache WSS4J (Merlin).
Using SoapUI to access the service, the request will succeed or fail based upon whitespace prior to the first element inside the <body>. The message will fail if:
(There do seem to be a few other nuances of this issue - adding additional blank lines between the <body> element and the first element of the body also means the message is successfully sent, despite having several spaces prior to the first element.)
The error that's returned when the message fails is
Please see attachment for examples of messages that succeed/fail.
Has anyone seen this issue before - is it likely to be an issue with SoapUI or with the service implementation?
Thanks for your help.
Using SoapUI to access the service, the request will succeed or fail based upon whitespace prior to the first element inside the <body>. The message will fail if:
- The first element is on the same line as the <body> tag
- The first element is on the line after the <body> tag, and there is more than two spaces prior to the element declaration
- There are spaces after the <body> element
(There do seem to be a few other nuances of this issue - adding additional blank lines between the <body> element and the first element of the body also means the message is successfully sent, despite having several spaces prior to the first element.)
The error that's returned when the message fails is
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">ns1:FailedCheck</faultcode>
<faultstring>The signature or decryption was invalid</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Please see attachment for examples of messages that succeed/fail.
Has anyone seen this issue before - is it likely to be an issue with SoapUI or with the service implementation?
Thanks for your help.