本文整理匯總了Java中javax.xml.ws.BindingProvider.getBinding方法的典型用法代碼示例。如果您正苦於以下問題:Java BindingProvider.getBinding方法的具體用法?Java BindingProvider.getBinding怎麽用?Java BindingProvider.getBinding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.xml.ws.BindingProvider
的用法示例。
在下文中一共展示了BindingProvider.getBinding方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setBinding
import javax.xml.ws.BindingProvider; //導入方法依賴的package包/類
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);
}
示例2: setupService
import javax.xml.ws.BindingProvider; //導入方法依賴的package包/類
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);
}
示例3: createPort
import javax.xml.ws.BindingProvider; //導入方法依賴的package包/類
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;
}