本文整理汇总了Java中javax.xml.ws.Binding.setHandlerChain方法的典型用法代码示例。如果您正苦于以下问题:Java Binding.setHandlerChain方法的具体用法?Java Binding.setHandlerChain怎么用?Java Binding.setHandlerChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.ws.Binding
的用法示例。
在下文中一共展示了Binding.setHandlerChain方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CertRAClient
import javax.xml.ws.Binding; //导入方法依赖的package包/类
public CertRAClient(String location) {
CertRaService certRaService = CertRaServiceFactory.newInstance();
this.port = certRaService.getCertRaPort();
BindingProvider bindingProvider = (BindingProvider) this.port;
bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
List<Handler> handlerChain = binding.getHandlerChain();
handlerChain.add(new LoggingHandler());
// LoggingHandler makes CXF fail on the attachments.
// https://issues.apache.org/jira/browse/CXF-5496
binding.setHandlerChain(handlerChain);
this.protocolObjectFactory = new be.e_contract.mycarenet.certra.jaxb.protocol.ObjectFactory();
}
示例2: EHealthSTSClient
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* Main constructor.
*
* @param location
* the URL of the eHealth STS web service.
*/
public EHealthSTSClient(String location) {
EHealthSamlStsService service = EHealthSamlStsServiceFactory
.newInstance();
QName portQName = new QName("urn:be:ehealth:saml:sts:1.0",
"EHealthSamlStsPort");
this.dispatch = service.createDispatch(portQName, Source.class,
Service.Mode.PAYLOAD);
this.dispatch.getRequestContext().put(
Dispatch.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = dispatch.getBinding();
@SuppressWarnings("rawtypes")
List<Handler> handlerChain = binding.getHandlerChain();
this.wsSecuritySOAPHandler = new WSSecuritySOAPHandler();
handlerChain.add(this.wsSecuritySOAPHandler);
handlerChain.add(new LoggingHandler());
binding.setHandlerChain(handlerChain);
}
示例3: XKMSClient
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* Main constructor.
*
* @param location
* the URL of the MyCareNet XKMS web service.
*/
public XKMSClient(String location) {
XMLKeyManagementService service = XKMSServiceFactory.newInstance();
this.port = service.getKeyServiceSoapPort();
BindingProvider bindingProvider = (BindingProvider) this.port;
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List<Handler> handlerChain = binding.getHandlerChain();
handlerChain.add(new LoggingHandler());
this.proofOfPossessionSignatureSOAPHandler = new ProofOfPossessionSignatureSOAPHandler();
handlerChain.add(this.proofOfPossessionSignatureSOAPHandler);
handlerChain.add(new LoggingHandler());
binding.setHandlerChain(handlerChain);
this.objectFactory = new ObjectFactory();
this.xmldsigObjectFactory = new be.e_contract.mycarenet.jaxb.xmldsig.ObjectFactory();
}
示例4: configureBindingProvider
import javax.xml.ws.Binding; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBindingProvider(BindingProvider bindingProvider,
String location) {
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List handlerChain = binding.getHandlerChain();
handlerChain.add(this.wsSecuritySOAPHandler);
handlerChain.add(this.inboundAttachmentsSOAPHandler);
// handlerChain.add(new LoggingHandler());
// LoggingHandler makes CXF fail on the attachments.
// https://issues.apache.org/jira/browse/CXF-5496
binding.setHandlerChain(handlerChain);
}
示例5: decorate
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* Decorates a given JAX-WS port with the required security handlers.
*
* @param bindingProvider
* the JAX-WS port to decorate.
* @return the added payload logical JAX-WS handler.
*/
public PayloadLogicalHandler decorate(BindingProvider bindingProvider) {
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, this.location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List<Handler> handlerChain = binding.getHandlerChain();
SecuritySOAPHandler sessionKeySignatureSOAPHandler = new SecuritySOAPHandler(
this.sessionKey, this.packageLicenseKey);
handlerChain.add(sessionKeySignatureSOAPHandler);
handlerChain.add(new LoggingHandler());
PayloadLogicalHandler payloadLogicalHandler = new PayloadLogicalHandler();
handlerChain.add(payloadLogicalHandler);
binding.setHandlerChain(handlerChain);
return payloadLogicalHandler;
}
示例6: setBinding
import javax.xml.ws.Binding; //导入方法依赖的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);
}
示例7: getPort
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* this is for Client Stub Programming
*
* @param t
* @param s
* @param args
* @return
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> T getPort(T t, Service s, Object[] args) {
Class<T> clz = null;
if (Class.class.isAssignableFrom(args[0].getClass())) {
clz = (Class<T>) args[0];
}
else if (Class.class.isAssignableFrom(args[1].getClass())) {
clz = (Class<T>) args[1];
}
if (clz == null) {
return t;
}
Binding binding = ((BindingProvider) t).getBinding();
List<Handler> handlerChain = binding.getHandlerChain();
handlerChain.add(this.handler);
binding.setHandlerChain(handlerChain);
final String wsdlLocation = getServiceURL(s);
T tProxy = JDKProxyInvokeUtil.newProxyInstance(clz.getClassLoader(), new Class[] { clz },
new JDKProxyInvokeHandler<T>(t, new ClientStubProcessor(wsdlLocation.toString(), this.handler)));
return tProxy;
}
示例8: createDispatch
import javax.xml.ws.Binding; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public Dispatch createDispatch(Dispatch d, Service s, Object[] args) {
Binding binding = ((BindingProvider) d).getBinding();
List<Handler> handlerChain = binding.getHandlerChain();
handlerChain.add(this.handler);
binding.setHandlerChain(handlerChain);
final String wsdlLocation = getServiceURL(s);
Dispatch tProxy = JDKProxyInvokeUtil.newProxyInstance(this.getClass().getClassLoader(),
new Class[] { Dispatch.class },
new JDKProxyInvokeHandler<Dispatch>(d, new DispatchProcessor(wsdlLocation.toString(), this.handler)));
return tProxy;
}
示例9: addMessageHandler
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* Add a message handler to a SOAP binding
* @param binding binding to which we'll add the handler
* @param handler the handler to be added
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void addMessageHandler(Object binding, SOAPHandler<SOAPMessageContext> handler) {
final Binding b = ((BindingProvider) binding).getBinding();
List handlerList = b.getHandlerChain();
if (handlerList == null)
handlerList = new ArrayList();
handlerList.add(handler);
b.setHandlerChain(handlerList);
}
示例10: setupConfigHandlers
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* Setups a given Binding instance using a specified CommonConfig
*
* @param binding the Binding instance to setup
* @param config the CommonConfig with the input configuration
*/
@SuppressWarnings("rawtypes")
public void setupConfigHandlers(Binding binding, CommonConfig config)
{
if (config != null) {
//start with the use handlers only to remove the previously set configuration
List<Handler> userHandlers = getNonConfigHandlers(binding.getHandlerChain());
List<Handler> handlers = convertToHandlers(config.getPreHandlerChains(), binding.getBindingID(), true); //PRE
handlers.addAll(userHandlers); //ENDPOINT
handlers.addAll(convertToHandlers(config.getPostHandlerChains(), binding.getBindingID(), false)); //POST
binding.setHandlerChain(handlers);
}
}
示例11: configureBindingProvider
import javax.xml.ws.Binding; //导入方法依赖的package包/类
private void configureBindingProvider(BindingProvider bindingProvider,
String location) {
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
List handlerChain = binding.getHandlerChain();
handlerChain.add(this.wsSecuritySOAPHandler);
handlerChain.add(new LoggingHandler());
binding.setHandlerChain(handlerChain);
}
示例12: configureBindingProvider
import javax.xml.ws.Binding; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBindingProvider(BindingProvider bindingProvider, String location) {
bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List handlerChain = binding.getHandlerChain();
handlerChain.add(this.wsSecuritySOAPHandler);
binding.setHandlerChain(handlerChain);
}
示例13: configureBindingProvider
import javax.xml.ws.Binding; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBindingProvider(BindingProvider bindingProvider,
String location) {
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List handlerChain = binding.getHandlerChain();
handlerChain.add(this.wsSecuritySOAPHandler);
handlerChain.add(new LoggingHandler());
handlerChain.add(this.payloadLogicalHandler);
binding.setHandlerChain(handlerChain);
}
示例14: configureBindingProvider
import javax.xml.ws.Binding; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBindingProvider(BindingProvider bindingProvider,
String location) {
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List handlerChain = binding.getHandlerChain();
handlerChain.add(new LoggingHandler());
handlerChain.add(this.payloadLogicalHandler);
binding.setHandlerChain(handlerChain);
}
示例15: XKMS2Client
import javax.xml.ws.Binding; //导入方法依赖的package包/类
/**
* Main constructor.
*
* @param location
* the URL of the MyCareNet XKMS 2.0 web service.
*/
public XKMS2Client(String location) {
XMLKeyManagementService service = XKMS2ServiceFactory.newInstance();
this.keyServicePort = service.getKeyServiceSoapPort();
BindingProvider bindingProvider = (BindingProvider) this.keyServicePort;
bindingProvider.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
Binding binding = bindingProvider.getBinding();
@SuppressWarnings("rawtypes")
List<Handler> handlerChain = binding.getHandlerChain();
this.proofOfPossessionSignatureSOAPHandler = new ProofOfPossessionSignatureSOAPHandler();
handlerChain.add(new LoggingHandler());
handlerChain.add(this.proofOfPossessionSignatureSOAPHandler);
this.keyBindingAuthenticationSignatureSOAPHandler = new KeyBindingAuthenticationSignatureSOAPHandler();
handlerChain.add(this.keyBindingAuthenticationSignatureSOAPHandler);
handlerChain.add(new LoggingHandler());
binding.setHandlerChain(handlerChain);
this.objectFactory = new ObjectFactory();
this.xmldsigObjectFactory = new be.e_contract.mycarenet.jaxb.xmldsig.ObjectFactory();
try {
this.datatypeFactory = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
throw new RuntimeException("DatatypeFactory error: "
+ e.getMessage(), e);
}
}