I am trying to validate a signature produced using AXIS+WSS4J client. The validation is performed by using AXIS+WSS4J on the provider side. The signature is performed on the body element in soap message
However during signature validation process I am getting an error "digest value mismatch". I think the message after it is signed is modified and this may be the reason of failure of signature validation. If I try to print the request soap message using a handler using the api org.apache.axis.utils.XMLUtils.DocumentToString or using the code Message reqMessage = messageContext.getRequestMessage(); reqMessage.writeTo(System.out); then I am seeing the soap message "somewhat" formatted and printed like this <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <getPoints xmlns="http://www.lisa.com"> <request> <ns1:languageID xsi:nil="true" xmlns:ns1="http://shr.maria.com"/> <cardNumber>454545454</cardNumber> </request> </getPoints> </soapenv:Body> </soapenv:Envelope> I am not sure on how AXIS internally representing this soap message when tranferring on the wire from one to other end but I am looking for below kind of soap message which does not have any indentation, formatting, new lien characters, line feeds, spaces etc. <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getPoints xmlns="http://www.lisa.com"><request><ns1:languageID xsi:nil="true" xmlns:ns1="http://shr.maria.com"/><cardNumber>454545454</cardNumber></request></getPoints></soapenv:Body></soapenv:Envelope> and since the above soap message does not have any new line characters, line feeds, spaces etc. and so that even if I sign the above message there will not be any formatting issues that may cause the signature validation to fail on the provider end. Can anyone please tell me how to remove such formatting of soap message and disable pretty printing/formatting of soap messages. I tried these parameters in both client-config.wsdd on client side and server-config.wsdd on the provider side but no avail. <parameter name="enableNamespacePrefixOptimization" value="false"/> <parameter name="disablePrettyXML" value="true"/> Thank you in advance. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
