Note that there are some explanatory texts on larger screens.

plurals
  1. POJAXWS Metro client for secured webservice with usernametoken profile
    primarykey
    data
    text
    <p>i want to consume a webservice that uses oasis style username token profile ( <a href="http://www.oasis-open.org/committees/download.php/16782/wss-v1.1-spec-os" rel="nofollow">http://www.oasis-open.org/committees/download.php/16782/wss-v1.1-spec-os</a>... ).</p> <p>I was able to do it with CXF and Weblogic clients BUT iw woul like to use a pure Metro client. </p> <p>Do you know how can I do that ?</p> <p>Thanks.</p> <p>CXF sample:</p> <pre><code> serviceClientPort = clientFactory.buildClientPort(wsdlUrl,null); org.apache.cxf.endpoint.Client clientProxy = ClientProxy.getClient(serviceClientPort); org.apache.cxf.endpoint.Endpoint cxfEndpoint = clientProxy.getEndpoint(); Map&lt;String, Object&gt; outProps = new HashMap&lt;String, Object&gt;(); outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN); outProps.put(WSHandlerConstants.USER, "someuser"); outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST); outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,CapHardcodedPassProvider.class.getName()); WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); cxfEndpoint.getOutInterceptors().add(wssOut); </code></pre> <p>Weblogic client :</p> <pre><code>CallService callService = new CallService(wsdlUrl,CAP_QNAME); CallServicePort port = callService.getCallServiceSoapPort(new WebServiceFeature[] { cpf }); BindingProvider bindingProvider = (BindingProvider) port; Map&lt;String, Object&gt; rc = (Map&lt;String, Object&gt;) bindingProvider.getRequestContext(); List&lt;CredentialProvider&gt; credProviders = new ArrayList&lt;CredentialProvider&gt;(); credProviders.add(new ClientUNTCredentialProvider(USERNAME.getBytes(), PASSWORD.getBytes())); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload