2 Replies Latest reply on Jan 14, 2009 3:54 AM by asoldano

    Glassfish interopepability. Invoking ws-security service dep

    lauri

      Hi.

      There is a glassfish server running a webservice protected by Username token.
      Somehow it should be invoked from a servlet running in jboss 4.2.3 server.

      After couple of attempts to invoke the service I've ended up with exception
      org.jboss.ws.WSException: Policy not supported! #ReceptionHelperPortBindingPolicy

      You can find policy part of wsdl definition below.

      Glassfish community has lots of "simple" examples where one should add file "webservices-rt.jar" to classpath in order to run example. This file is bundled with glassfish distribution. This option works well for standalone applications, but not when runnig application inside jboss or tomcat.

      Please share ideas how it can be done or where could I have look for a clue.

      Here is code to invoke ws

      ...
      // url points to glassfish server
      URL url = new URL("http://localhost:8080/ws/Helper?wsdl");
      QName qn = new QName("http://ws.reception/", "Helper");
      Service s = Service.create(url, qn); // this is the line where "Policy not supported" exception is thrown
      




      <ns1:Policy xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/policy" wsu:Id="ReceptionHelperPortBindingPolicy">
       <ns1:ExactlyOne>
       <ns1:All>
       <ns2:SignedSupportingTokens xmlns:ns2="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns2:UsernameToken ns2:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns2:WssUsernameToken10></ns2:WssUsernameToken10>
       </ns1:All>
       </ns1:ExactlyOne>
       </ns1:Policy>
       </ns2:UsernameToken>
      
       </ns1:All>
       </ns1:ExactlyOne>
       </ns1:Policy>
       </ns2:SignedSupportingTokens>
       <ns3:TransportBinding xmlns:ns3="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns3:AlgorithmSuite>
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns3:Basic128></ns3:Basic128>
       </ns1:All>
       </ns1:ExactlyOne>
       </ns1:Policy>
       </ns3:AlgorithmSuite>
      
       <ns3:IncludeTimestamp></ns3:IncludeTimestamp>
       <ns3:Layout>
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns3:Lax></ns3:Lax>
       </ns1:All>
       </ns1:ExactlyOne>
       </ns1:Policy>
       </ns3:Layout>
       <ns3:TransportToken>
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns3:HttpsToken RequireClientCertificate="false"></ns3:HttpsToken>
       </ns1:All>
       </ns1:ExactlyOne>
      
       </ns1:Policy>
       </ns3:TransportToken>
       </ns1:All>
       </ns1:ExactlyOne>
       </ns1:Policy>
       </ns3:TransportBinding>
       <ns4:Wss10 xmlns:ns4="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
       <ns1:Policy>
       <ns1:ExactlyOne>
       <ns1:All>
       <ns4:MustSupportRefKeyIdentifier></ns4:MustSupportRefKeyIdentifier>
       </ns1:All>
       </ns1:ExactlyOne>
       </ns1:Policy>
       </ns4:Wss10>
       <ns5:UsingAddressing xmlns:ns5="http://www.w3.org/2006/05/addressing/wsdl"></ns5:UsingAddressing>
       </ns1:All>
      
       </ns1:ExactlyOne>
      </ns1:Policy>
      


        • 1. Re: Glassfish interopepability. Invoking ws-security service
          lauri

          I've tried to install JBossWS-metro. But still no luck
          By default application fails with
          Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: org.jboss.ws.core.jaxws.spi.ProviderImpl

          If i add jbossws-client.jar or jbossws-metro-client.jar to .war servlet fails with
          org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException: faultCode=CONFIGURATION_ERROR: Problem instantiating factory implementation.: java.lang.ClassNotFoundException: org.jboss.ws.tools.wsdl.JBossWSDLFactoryImpl

          • 2. Re: Glassfish interopepability. Invoking ws-security service
            asoldano

            JBossWS-Native does not support WS-Security Policy, so you're right, you need to use JBossWS-Metro in your case.

            This said, considering the error you get, your current installation is broken, as the Metro stack seems to be looking for Native classes (org.jboss.ws.core.jaxws.spi.ProviderImpl).
            I'd suggest reinstalling jbossws-metro (and double-checking the result because of this issue with JBoss 4.2.3 only https://jira.jboss.org/jira/browse/JBWS-2377).