Brian, WSS4J uses a specific Axis method to set the message generated by WSS4J that includes the security header as the new message to send. Maybe there is a problem in that area - I'll test this during the next day (maybe weekend).
It would be helpful if you can provide me the message you are going to send (the XML string). Do you escape the angle bracket in your program or is this an embedded Axis function? Regards, Werner Brian Shields wrote: > Werner, > Yes I have tested it without security in place and is working fine! > Angle brackets are modified to < to avoid errors! > Regards, > Brian. > > Werner Dittmann wrote: > >> Brian, >> >> did you test this without security enabled? Sending an XML string >> may require some modifications to escape angle bracket. >> >> Regards, >> Werner >> >> >> Brian Shields wrote: >> >> >>> Hi Guys, >>> I have a secure service established using wss4j and connect to it using >>> a simple client. For testing purposes this is an echo service. It works >>> perfectly when i pass a simple string as the parameter to the call, >>> however when i pass it a string which is generated from an >>> org.jdom.Document using an org.jdom.output.XMLOutputter i get the errors >>> below. Is there something i have to do to the String? or the Document >>> before outputting? >>> Thanks, >>> Brian. >>> >>> org.apache.ws.security.WSSecurityException: Cannot encrypt/decrypt data; >>> nested exception is: >>> org.apache.xml.security.encryption.XMLEncryptionException: Error >>> while decoding >>> Original Exception was >>> org.apache.xml.security.exceptions.Base64DecodingException: Error while >>> decoding >>> at >>> org.apache.ws.security.processor.EncryptedKeyProcessor.decryptDataRef(EncryptedKeyProcessor.java:388) >>> >>> >>> at >>> org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:313) >>> >>> >>> at >>> org.apache.ws.security.processor.EncryptedKeyProcessor.handleEncryptedKey(EncryptedKeyProcessor.java:81) >>> >>> >>> at >>> org.apache.ws.security.processor.EncryptedKeyProcessor.handleToken(EncryptedKeyProcessor.java:75) >>> >>> >>> at >>> org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:252) >>> >>> >>> at >>> org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:179) >>> >>> >>> at >>> org.apache.axis2.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java:161) >>> >>> at org.apache.axis2.engine.Phase.invoke(Phase.java:376) >>> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:351) >>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:322) >>> at >>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:274) >>> >>> >>> at >>> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:150) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >>> at >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) >>> >>> >>> at >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) >>> >>> >>> at >>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) >>> >>> >>> at >>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) >>> >>> >>> at >>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) >>> >>> >>> at >>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) >>> >>> >>> at >>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) >>> >>> >>> at >>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) >>> >>> at >>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) >>> >>> at >>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) >>> >>> >>> at >>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) >>> >>> >>> at >>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) >>> >>> >>> at >>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) >>> >>> >>> at java.lang.Thread.run(Unknown Source) >>> Caused by: org.apache.xml.security.encryption.XMLEncryptionException: >>> Error while decoding >>> Original Exception was >>> org.apache.xml.security.exceptions.Base64DecodingException: Error while >>> decoding >>> at >>> org.apache.xml.security.encryption.XMLCipherInput.getDecryptBytes(Unknown >>> >>> Source) >>> at org.apache.xml.security.encryption.XMLCipherInput.getBytes(Unknown >>> Source) >>> at >>> org.apache.xml.security.encryption.XMLCipher.decryptToByteArray(Unknown >>> Source) >>> at >>> org.apache.xml.security.encryption.XMLCipher.decryptElement(Unknown >>> Source) >>> at >>> org.apache.xml.security.encryption.XMLCipher.decryptElementContent(Unknown >>> >>> Source) >>> at org.apache.xml.security.encryption.XMLCipher.doFinal(Unknown >>> Source) >>> at >>> org.apache.ws.security.processor.EncryptedKeyProcessor.decryptDataRef(EncryptedKeyProcessor.java:386) >>> >>> >>> ... 27 more >>> >>> >> >> >> >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
