7 Replies Latest reply on Apr 11, 2014 10:20 AM by Fuat OZERGIL

    Policy not supported for UsernameTokenOverHTTPS error.

    Hugo G Newbie

      Hi,

       

      I am new to JBossWS and have run into a problem with WS-Security.  I am after some pointers on how to get around the problem.  I am obviously doing something very wrong!  I have encountered this problem with JBoss 4.2.3.GA + jbossws-native-3.1.1.GA and JBoss 5.0.1.GA + jbossws-native-3.2.2.GA.

       

      When calling an endpoint I get the following error.

       

      org.jboss.ws.WSException: Policy not supported! #UsernameTokenOverHTTPS
          at org.jboss.ws.WSException.rethrow(WSException.java:60)
          at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.deployPolicyClientSide(PolicyMetaDataBuilder.java:316)
          at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.deployPolicy(PolicyMetaDataBuilder.java:274)
          at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.processPolicies(PolicyMetaDataBuilder.java:220)
          at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.processPolicyExtensions(PolicyMetaDataBuilder.java:203)
          at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:93)
          at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:146)
          at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:117)
          at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:111)
          at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104)
          at javax.xml.ws.Service.<init>(Service.java:56)

      ...

      Caused by: org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy
          at org.jboss.ws.extensions.policy.deployer.PolicyDeployer.deployClientSide(PolicyDeployer.java:174)
          at org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder.deployPolicyClientSide(PolicyMetaDataBuilder.java:307)

       

      The wsdl fragment showing the security policy is below.

       

      <wsp:Policy wsu:Id="UsernameTokenOverHTTPS" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
          <wsp:ExactlyOne>
            <wsp:All>
              <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <wsp:Policy>
      ...
                </wsp:Policy>
              </sp:TransportBinding>
              <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                <wsp:Policy>
                  <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always"/>
                </wsp:Policy>
              </sp:SupportingTokens>
            </wsp:All>
          </wsp:ExactlyOne>
        </wsp:Policy>

       

      I noticed that org.jboss.ws.extensions.policy.deployer.PolicyDeployer does not support "http://schemas.xmlsoap.org/ws/2004/09/policy".  Is this the problem?  How to get support for UsernameTokenOverHTTPS?

       

      Thanks,

        Hugo