Werner,

Thanks for this remark - I wan't aware of the Crimson namespace problem. Now I got one step further. Unfortunately there is still something wrong. I am sending a SOAP array and when I sign the msg I cannot retrieve the string values from this array. Instead I simply get 'null' for each array item. tcpmon shows that the signed msg with the correct array values is send but the client seems to have a problem. There is no error message. Running the WS without security everything works fine.

Ideas?

Regards,
Stefan

Werner Dittmann wrote:

Stefan,

acording to the stack printout you use the crimson parser
at the client side. Crimson does _not_ support namespaces
fully (only partial support). Pls make sure you have a
fully namespace aware parser first in your classpath, e.g.
xerces.

AFAIK Crimson is the standard parser for JDK 1.4.x, but I'm
not sure if Crimson is supported by Apache anymore.

Regards,
Werner


Stefan Schmidt wrote:
Hi,

I managed to get an example going as follows:

Axis client --> (UsernameToken Encrypt) --> JAXRPC server (this works
perfectly)

Now I am trying to sign and encrypt the server response:

JAXRPC server --> (Signature Encrypt) --> Axis client (the server sends
the encrypted and signed SOAP message but the client throws a NPE)

Here are my settings for scenario 2:

server: webservices.xml
<handler>
              <handler-name>Outbound Security Handler</handler-name>
<handler-class>org.apache.ws.security.handler.WSS4JHandler</handler-class>
              <init-param>
                   <param-name>deployment</param-name>
                   <param-value>server</param-value>
               </init-param>
               <init-param>
                   <param-name>action</param-name>
                   <param-value>Signature Encrypt</param-value>
               </init-param>
               <init-param>
                   <param-name>passwordCallbackClass</param-name>
<param-value>com.ibm.dw.bookshop.handlers.PWCallbackHandler</param-value>
               </init-param>
               <init-param>
                   <param-name>flow</param-name>
                   <param-value>response-only</param-value>
               </init-param>
               <init-param>
                   <param-name>user</param-name>
<param-value>16c73ab6-b892-458f-abf5-2f875f74882e</param-value>
               </init-param>
               <init-param>
                   <param-name>signaturePropFile</param-name>
                   <param-value>crypto.properties</param-value>
               </init-param>
  </handler>

client: axis-client.wsdd
<responseFlow >
 <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
      <parameter name="passwordCallbackClass"
value="com.ibm.dw.bookshop.j2seclient.handlers.PWCallbackHandler"/>
      <parameter name="action" value="Signature Encrypt"/>
      <parameter name="signaturePropFile" value="crypto.properties"
/>        </handler>
</responseFlow >

The callbackhandlers have the PWCallback1 contents.

In the TCPMon I can see that the server sends the encrypted msg properly.

At the client I get the following NPE (the stubs were generated without
security in place - I figure this doesn't matter because the wsdl
doesn't change - right?):

{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
   [java] at
org.apache.crimson.tree.ElementNode2.getAttributeNodeNS(Unknown Source)
   [java] at
org.apache.crimson.tree.ElementNode2.hasAttributeNS(Unknown Source)
   [java] at
org.apache.ws.security.util.WSSecurityUtil.findElementById(WSSecurityUtil.java:363)

   [java] at
org.apache.ws.security.util.WSSecurityUtil.getElementByWsuId(WSSecurityUtil.java:547)

   [java] at
org.apache.ws.security.WSSecurityEngine.decryptDataRef(WSSecurityEngine.java:1211)

   [java] at
org.apache.ws.security.WSSecurityEngine.handleEncryptedKey(WSSecurityEngine.java:1188)

   [java] at
org.apache.ws.security.WSSecurityEngine.handleEncryptedKey(WSSecurityEngine.java:943)

   [java] at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:363)

   [java] at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:259)

   [java] at
org.apache.ws.axis.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java:183)

   [java] at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

   [java] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   [java] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   [java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:190)
   [java] at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
   [java] at org.apache.axis.client.Call.invoke(Call.java:2748)
   [java] at org.apache.axis.client.Call.invoke(Call.java:2424)
   [java] at org.apache.axis.client.Call.invoke(Call.java:2347)
   [java] at org.apache.axis.client.Call.invoke(Call.java:1804)
   [java] at
com.ibm.dw.bookshop.j2seclient.jse.generated.XMethodsNamesSEIBindingStub.getXMethodsWebServiceNames(XMethodsNamesSEIBindingStub.java:159)

   [java] at
com.ibm.dw.bookshop.j2seclient.BookShopClientFrame.invokeServletSEI(BookShopClientFrame.java:247)

   [java] at
com.ibm.dw.bookshop.j2seclient.BookShopClientFrame.access$200(BookShopClientFrame.java:54)

   [java] at
com.ibm.dw.bookshop.j2seclient.BookShopClientFrame$3.run(BookShopClientFrame.java:177)

   [java] at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   [java] at java.awt.EventQueue.dispatchEvent(Unknown Source)
   [java] at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   [java] at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   [java] at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   [java] at java.awt.EventDispatchThread.run(Unknown Source)
   [java] {http://xml.apache.org/axis/}hostname:stefan
   [java] java.lang.NullPointerException
   [java] at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
   [java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
   [java] at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
   [java] at org.apache.axis.client.Call.invoke(Call.java:2748)
   [java] at org.apache.axis.client.Call.invoke(Call.java:2424)
   [java] at org.apache.axis.client.Call.invoke(Call.java:2347)
   [java] at org.apache.axis.client.Call.invoke(Call.java:1804)
   [java] at
com.ibm.dw.bookshop.j2seclient.jse.generated.XMethodsNamesSEIBindingStub.getXMethodsWebServiceNames(XMethodsNamesSEIBindingStub.java:159)

   [java] at
com.ibm.dw.bookshop.j2seclient.BookShopClientFrame.invokeServletSEI(BookShopClientFrame.java:247)

   [java] at
com.ibm.dw.bookshop.j2seclient.BookShopClientFrame.access$200(BookShopClientFrame.java:54)

   [java] at
com.ibm.dw.bookshop.j2seclient.BookShopClientFrame$3.run(BookShopClientFrame.java:177)

   [java] at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   [java] at java.awt.EventQueue.dispatchEvent(Unknown Source)
   [java] at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   [java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   [java] at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   [java] at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   [java] at java.awt.EventDispatchThread.run(Unknown Source)
   [java] Caused by: java.lang.NullPointerException
   [java] at
org.apache.crimson.tree.ElementNode2.getAttributeNodeNS(Unknown Source)
   [java] at
org.apache.crimson.tree.ElementNode2.hasAttributeNS(Unknown Source)
   [java] at
org.apache.ws.security.util.WSSecurityUtil.findElementById(WSSecurityUtil.java:363)

   [java] at
org.apache.ws.security.util.WSSecurityUtil.getElementByWsuId(WSSecurityUtil.java:547)

   [java] at
org.apache.ws.security.WSSecurityEngine.decryptDataRef(WSSecurityEngine.java:1211)

   [java] at
org.apache.ws.security.WSSecurityEngine.handleEncryptedKey(WSSecurityEngine.java:1188)

   [java] at
org.apache.ws.security.WSSecurityEngine.handleEncryptedKey(WSSecurityEngine.java:943)

   [java] at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:363)

   [java] at
org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:259)

   [java] at
org.apache.ws.axis.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java:183)

   [java] at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

   [java] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   [java] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   [java] at org.apache.axis.client.AxisClient.invoke(AxisClient.java:190)
   [java] ... 16 more

Thanks for your help!

Regards,

Stefan

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




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




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

Reply via email to