5 Replies Latest reply on Jun 11, 2009 5:41 PM by kj_newbie

    JAXWS handlers

    kj_newbie

      Hello,

      I am new to JBossWS and my task is to get a given WS work with Handlers. The handlers are responsible for securing the SOAP Request through another API (to be precise - OpenSSO STS API)

      I got this to work on Weblogic container and since JAX WS is a standard followed by JBoss also, I would assume, the same handler implementation would work here too (with minor config changes). But, I get the following exception when I run the client.

      13:32:06,250 ERROR [STDERR] java.lang.IllegalArgumentException: SOAPElement expected
      13:32:06,250 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPBodyImpl.convertToBodyElement(SOAPBody
      Impl.java:296)
      13:32:06,250 ERROR [STDERR] at org.jboss.ws.core.soap.SOAPBodyImpl.appendChild(SOAPBodyImpl.java
      :200)
      13:32:06,250 ERROR [STDERR] at com.sun.identity.wss.sts.TrustAuthorityClient.getTrustResponse(Tr
      ustAuthorityClient.java:566)
      13:32:06,250 ERROR [STDERR] at com.sun.identity.wss.sts.TrustAuthorityClient.getSTSToken(TrustAu
      thorityClient.java:540)
      13:32:06,250 ERROR [STDERR] at com.sun.identity.wss.sts.TrustAuthorityClient.getSecurityToken(Tr
      ustAuthorityClient.java:280)
      13:32:06,250 ERROR [STDERR] at com.sun.identity.wss.sts.TrustAuthorityClient.getSecurityToken(Tr
      ustAuthorityClient.java:108)
      13:32:06,312 ERROR [STDERR] at com.sun.identity.wss.security.handler.SOAPRequestHandler.secureRe
      quest(SOAPRequestHandler.java:607)
      13:32:06,312 ERROR [STDERR] at com.sun.samples.ClientHandler.handleMessage(ClientHandler.java:70
      )
      13:32:06,312 ERROR [STDERR] at com.sun.samples.ClientHandler.handleMessage(ClientHandler.java:1)
      
      13:32:06,312 ERROR [STDERR] at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessag
      e(HandlerChainExecutor.java:305)
      


      I am not sure what's causing this exception so for debugging, I start with the handler config files for JBoss. The handler on the client side looks like the following. Does it look right or am I missing something here?

      <bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       wsdlLocation="http://localhost:8080/StockQuoteImpl?WSDL"
       xmlns="http://java.sun.com/xml/ns/jaxws">
       <bindings node="wsdl:definitions"
       xmlns:jws="http://java.sun.com/xml/ns/javaee">
       <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
       <handler-chain>
       <handler>
       <handler-class>com.sun.samples.ClientHandler</handler-class>
       </handler>
       </handler-chain>
       </handler-chains>
      </bindings>
      </bindings>


      On the server side it is as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <handler-config>
      <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
       <handler-chain>
       <handler-chain-name>SimpleChain</handler-chain-name>
       <handler>
       <handler-name>handler1</handler-name>
       <handler-class>com.sun.samples.ServerHandler</handler-class>
       </handler>
       </handler-chain>
      </handler-chains>
      </handler-config>
      


      Any insights/useful hints will be greatly appreciated.

      Thanks

        • 1. Re: JAXWS handlers
          kj_newbie

          Little bit of googling leads to some issues with the SAAJ implementation from JBoss.

          Can anyone please tell me if there is a workaround?

          Thanks

          • 2. Re: JAXWS handlers
            ropalka

            What JBossWS version are you using?

            • 3. Re: JAXWS handlers
              kj_newbie

              It's JBossWS 3.1.1 native on JBoss 5.0.0.
              I tired the JBoss with jdk 6 (copied jars to endorsed dir) and with jdk 5 but I get same issue.
              I also tried with the 3.1.1 metro but I could not even deploy my web service to that one. The same webservice that worked with the native, did not work with metro !!

              Thanks
              Kamna

              • 4. Re: JAXWS handlers
                kj_newbie

                OK. so, it worked fine with the metro stack of jbossws (3.1.1)
                Had to change the web service a little but.

                Thanks

                • 5. Re: JAXWS handlers
                  kj_newbie

                  Seems to be working fine with Metro and CXF.
                  Still not working with the native :(

                  One thing I noticed is that the endorsed folder has the native jboss jars for jaxws, saaj etc. but the other two are not dependent on that.

                  Is this the problem? How can we override these jars and use the saaj-impl and saaj-api even with the native jbossws dist ?

                  Thanks