Java Code Examples for javax.xml.ws.BindingProvider.getBinding()

The following are Jave code examples for showing how to use getBinding() of the javax.xml.ws.BindingProvider class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: oscm-app   File: BesDAO.java   Source Code and License Vote up 5 votes
private void setBinding(BindingProvider client, String userName, String password) {
    final Binding binding = client.getBinding();
    List<Handler> handlerList = binding.getHandlerChain();
    if (handlerList == null)
        handlerList = new ArrayList<>();
    handlerList.add(new SOAPSecurityHandler(userName, password));
    binding.setHandlerChain(handlerList);
}
 
Example 2
Project: oscm   File: BesDAO.java   Source Code and License Vote up 5 votes
private void setBinding(BindingProvider client, String userName, String password) {
    final Binding binding = client.getBinding();
    List<Handler> handlerList = binding.getHandlerChain();
    if (handlerList == null)
        handlerList = new ArrayList<>();
    handlerList.add(new SOAPSecurityHandler(userName, password));
    binding.setHandlerChain(handlerList);
}
 
Example 3
Project: globallink-connect-api-java   File: ServiceLocator.java   Source Code and License Vote up 5 votes
private void setupService(BindingProvider bp, String serviceName,
    String url, Boolean enableMTOM, String proxyHost, int proxyPort,
    String proxyUser, String proxyPassword) {
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
	url + "services/" + serviceName + WS_VERSION);
if (proxyHost != null) {
    if (proxyHost.startsWith(HTTP_PREFIX)) {
	bp.getRequestContext().put(HTTP_PROXY_HOST, proxyHost);
	bp.getRequestContext().put(HTTP_PROXY_PORT, proxyPort);
	if (proxyUser != null && proxyUser.trim().length() > 0) {
	    bp.getRequestContext().put(HTTP_PROXY_USER, proxyUser);
	    bp.getRequestContext().put(HTTP_PROXY_PASSWORD,
		    proxyPassword);
	}
    } else if (proxyHost.startsWith(HTTPS_PREFIX)) {
	bp.getRequestContext().put(HTTPS_PROXY_HOST, proxyHost);
	bp.getRequestContext().put(HTTPS_PROXY_PORT, proxyPort);
	if (proxyUser != null && proxyUser.trim().length() > 0) {
	    bp.getRequestContext().put(HTTPS_PROXY_USER, proxyUser);
	    bp.getRequestContext().put(HTTPS_PROXY_PASSWORD,
		    proxyPassword);
	}
    }
}
SOAPBinding binding = (SOAPBinding) bp.getBinding();
binding.setMTOMEnabled(enableMTOM);

   }
 
Example 4
Project: common-libraries   File: XDSRepositorybClientTest.java   Source Code and License Vote up 5 votes
private DocumentRepositoryPortTypeProxy createPort() {
	final DocumentRepositoryPortTypeProxy port = new DocumentRepositoryService(wsdlURL, serviceName).getDocumentRepositoryPortSoap12();
	if (StringUtils.hasText(this.endpointAddress)) {
		final BindingProvider bp = port;
		bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
		
		SOAPBinding binding = (SOAPBinding) bp.getBinding();
		binding.setMTOMEnabled(true);
	}
	
	return port;
}