When validating SOAP message with Message Validation Policy I encounter the problems with message validation when they contain multiple namespaces.
My configuration:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageValidation name="validate-soap-message"> <DisplayName>Validate SOAP Message</DisplayName> <SOAPMessage version="1.1"/> <Source>message</Source> <ResourceURL>wsdl://example.wsdl</ResourceURL> </MessageValidation>
Example payload:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="http://URL/tns"> <soapenv:Header/> <soapenv:Body> <tns:getIncidentRequest> <tns:IncidentID>IM01941995</tns:IncidentID> </tns:getIncidentRequest> </soapenv:Body> </soapenv:Envelope>
And received error:
{"Envelope":{"encodingStyle":"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/","Body":{ "Fault":{ "faultactor":{}, "faultcode":"soap:Server", "faultstring":"validate-soap-message failed with reason: \"Unexpected Root Element tns:getIncidentRequest [Line 4]\"", "detail":{"source":{"errorcode":"steps.messagevalidation.Failed"}} } }}}
Any idea what is the source of the problem?
Solved! Go to Solution.
Upgrade to version 4.18.x solved the the problem.