Re: Additional XML prefixes when client receives SOAP fault
Hi, you can convert the XML document to a new document without the prefixes. Then execute your hash function on the new document. One way to convert XML documents is using XSLT. See this link for example: https://www.stylusstudio.com/xsllist/200812/post70070.html Chris82KS wrote: Hello, I have a problem with XML prefixes. When the SOAP message leaves the server with a fault the body looks like this: soapenv:Body xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; wsu:Id=Id-25568549 soapenv:Fault soapenv:Code soapenv:Valuesoapenv:Receiver/soapenv:Value /soapenv:Code soapenv:Reason soapenv:Text xml:lang=en-USENFORCED ERROR THROWN CORRECTLY/soapenv:Text /soapenv:Reason soapenv:Detail serviceFault xmlns=http://www.foo.net/test/xsd/sys/common; faultcode0010/faultcode reasonENFORCED ERROR THROWN CORRECTLY/reason node/ detailENFORCED ERROR THROWN CORRECTLY/detail ctxIdAC10014E0123F082FFAD0001/ctxId timestamp2009-09-25T11:23:32.156+02:00/timestamp /serviceFault /soapenv:Detail /soapenv:Fault /soapenv:Body But the client takes this body out of the stream: soapenv:Body xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; wsu:Id=Id-25568549 soapenv:Fault soapenv:Code soapenv:Valuesoapenv:Receiver/soapenv:Value /soapenv:Code soapenv:Reason soapenv:Text xml:lang=en-USENFORCED ERROR THROWN CORRECTLY/soapenv:Text /soapenv:Reason soapenv:Detail axis2ns1:serviceFault xmlns:axis2ns1=http://www.foo.net/test/xsd/sys/common; axis2ns1:faultcode0010/axis2ns1:faultcode axis2ns1:reasonENFORCED ERROR THROWN CORRECTLY/axis2ns1:reason axis2ns1:node/ axis2ns1:detailENFORCED ERROR THROWN CORRECTLY/axis2ns1:detail axis2ns1:ctxIdAC10014E0123F082FFAD0001/axis2ns1:ctxId axis2ns1:timestamp2009-09-25T11:23:32.156+02:00/axis2ns1:timestamp /axis2ns1:serviceFault /soapenv:Detail /soapenv:Fault /soapenv:Body You can see that there is no prefix in the serviceFault tag on the server side but the client puts the prefix axis2ns1 into the body. For me this is a problem because the body is signed on the server side and the client calculates the hash with this prefix. That leads to signature verification failure. Would be great if you can help me. Greetings Christian -- View this message in context: http://www.nabble.com/Additional-XML-prefixes-when-client-receives-SOAP-fault-tp25609385p25706726.html Sent from the Axis - User mailing list archive at Nabble.com.
Re: Additional XML prefixes when client receives SOAP fault
On Fri, Sep 25, 2009 at 3:23 PM, Christian Mielke c...@nc-ag.de wrote: Hello, I have a problem with XML prefixes. When the SOAP message leaves the server with a fault the body looks like this: soapenv:Body xmlns:wsu= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; wsu:Id=Id-25568549 soapenv:Fault soapenv:Code soapenv:Valuesoapenv:Receiver/soapenv:Value /soapenv:Code soapenv:Reason soapenv:Text xml:lang=en-USENFORCED ERROR THROWN CORRECTLY/soapenv:Text /soapenv:Reason soapenv:Detail serviceFault xmlns= http://www.foo.net/test/xsd/sys/common; faultcode0010/faultcode reasonENFORCED ERROR THROWN CORRECTLY/reason node/ detailENFORCED ERROR THROWN CORRECTLY/detail ctxIdAC10014E0123F082FFAD0001/ctxId timestamp2009-09-25T11:23:32.156+02:00/timestamp /serviceFault /soapenv:Detail /soapenv:Fault /soapenv:Body But the client takes this body out of the stream: soapenv:Body xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; xmlns:wsu= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; wsu:Id=Id-25568549 soapenv:Fault soapenv:Code soapenv:Valuesoapenv:Receiver/soapenv:Value /soapenv:Code soapenv:Reason soapenv:Text xml:lang=en-USENFORCED ERROR THROWN CORRECTLY/soapenv:Text /soapenv:Reason soapenv:Detail axis2ns1:serviceFault xmlns:axis2ns1= http://www.foo.net/test/xsd/sys/common; axis2ns1:faultcode0010/axis2ns1:faultcode axis2ns1:reasonENFORCED ERROR THROWN CORRECTLY/axis2ns1:reason axis2ns1:node/ axis2ns1:detailENFORCED ERROR THROWN CORRECTLY/axis2ns1:detail axis2ns1:ctxIdAC10014E0123F082FFAD0001/axis2ns1:ctxId axis2ns1:timestamp2009-09-25T11:23:32.156+02:00/axis2ns1:timestamp /axis2ns1:serviceFault /soapenv:Detail /soapenv:Fault /soapenv:Body You can see that there is no prefix in the serviceFault tag on the server side but the client puts the prefix axis2ns1 into the body. For me this is a problem because the body is signed on the server side and the client calculates the hash with this prefix. That leads to signature verification failure. Would be great if you can help me. do you sign the soap message using Rampart (ws-security implementation for Axis2) or with your code? thanks, Amila. Greetings Christian -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
Additional XML prefixes when client receives SOAP fault
Hello, I have a problem with XML prefixes. When the SOAP message leaves the server with a fault the body looks like this: soapenv:Body xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; wsu:Id=Id-25568549 soapenv:Fault soapenv:Code soapenv:Valuesoapenv:Receiver/soapenv:Value /soapenv:Code soapenv:Reason soapenv:Text xml:lang=en-USENFORCED ERROR THROWN CORRECTLY/soapenv:Text /soapenv:Reason soapenv:Detail serviceFault xmlns=http://www.foo.net/test/xsd/sys/common; faultcode0010/faultcode reasonENFORCED ERROR THROWN CORRECTLY/reason node/ detailENFORCED ERROR THROWN CORRECTLY/detail ctxIdAC10014E0123F082FFAD0001/ctxId timestamp2009-09-25T11:23:32.156+02:00/timestamp /serviceFault /soapenv:Detail /soapenv:Fault /soapenv:Body But the client takes this body out of the stream: soapenv:Body xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope; xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; wsu:Id=Id-25568549 soapenv:Fault soapenv:Code soapenv:Valuesoapenv:Receiver/soapenv:Value /soapenv:Code soapenv:Reason soapenv:Text xml:lang=en-USENFORCED ERROR THROWN CORRECTLY/soapenv:Text /soapenv:Reason soapenv:Detail axis2ns1:serviceFault xmlns:axis2ns1=http://www.foo.net/test/xsd/sys/common; axis2ns1:faultcode0010/axis2ns1:faultcode axis2ns1:reasonENFORCED ERROR THROWN CORRECTLY/axis2ns1:reason axis2ns1:node/ axis2ns1:detailENFORCED ERROR THROWN CORRECTLY/axis2ns1:detail axis2ns1:ctxIdAC10014E0123F082FFAD0001/axis2ns1:ctxId axis2ns1:timestamp2009-09-25T11:23:32.156+02:00/axis2ns1:timestamp /axis2ns1:serviceFault /soapenv:Detail /soapenv:Fault /soapenv:Body You can see that there is no prefix in the serviceFault tag on the server side but the client puts the prefix axis2ns1 into the body. For me this is a problem because the body is signed on the server side and the client calculates the hash with this prefix. That leads to signature verification failure. Would be great if you can help me. Greetings Christian