Werner,
I got distracted with other issues yesterday evening so didnt get to explore much more. What I have narrowed it down to is this:
It will send a simple string as a parameter both securely and unsecurely
It will send a simple xml string as a parameter both securely and unsecurely

The XML String i need to send, and it is having problems with, is quite complex. It contains a full XML document as a CDATA element of the parent document, where i am interested in sending the parent document. As i said, i have made some headway in narrowing down exxactly what is causing the errors and will repost when I find exactly what is causing it. BTW, there is an embedded axis function that escapes the angle brackets (only the < bracket needs to be escaped). This is not an issue as simple XML is working.

Regards,
Brian.

Werner Dittmann wrote:

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 &lt; 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







--
Brian Shields BSc. MSc.,
PhD Candidate,
Department of Information Technology,
National University of Ireland,
Galway,
Ireland.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to