1
オアシススタイルのユーザー名トークンプロファイル(http://www.oasis-open.org/committees/download.php/16782/wss-v1.1-spec-os ...)を使用するWebサービスを使用したいと考えています。JAXWSメトロクライアントのユーザーネームトークンプロファイル
私はCXFとWeblogicクライアントでもできましたが、純粋なMetroクライアントを使いたいと思っています。
どうすればいいですか?
ありがとうございました。
CXFサンプル:
serviceClientPort = clientFactory.buildClientPort(wsdlUrl,null);
org.apache.cxf.endpoint.Client clientProxy = ClientProxy.getClient(serviceClientPort);
org.apache.cxf.endpoint.Endpoint cxfEndpoint = clientProxy.getEndpoint();
Map<String, Object> outProps = new HashMap<String, Object>();
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);
WebLogicクライアント:
CallService callService = new CallService(wsdlUrl,CAP_QNAME);
CallServicePort port = callService.getCallServiceSoapPort(new WebServiceFeature[] { cpf });
BindingProvider bindingProvider = (BindingProvider) port;
Map<String, Object> rc = (Map<String, Object>) bindingProvider.getRequestContext();
List<CredentialProvider> credProviders = new ArrayList<CredentialProvider>();
credProviders.add(new ClientUNTCredentialProvider(USERNAME.getBytes(), PASSWORD.getBytes()));