本文整理汇总了Java中javax.xml.ws.Service.setHandlerResolver方法的典型用法代码示例。如果您正苦于以下问题:Java Service.setHandlerResolver方法的具体用法?Java Service.setHandlerResolver怎么用?Java Service.setHandlerResolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.ws.Service
的用法示例。
在下文中一共展示了Service.setHandlerResolver方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJaxWsService
import javax.xml.ws.Service; //导入方法依赖的package包/类
/**
* Create a JAX-WS Service according to the parameters of this factory.
* @see #setServiceName
* @see #setWsdlDocumentUrl
*/
public Service createJaxWsService() {
Assert.notNull(this.serviceName, "No service name specified");
Service service;
if (this.serviceFeatures != null) {
service = (this.wsdlDocumentUrl != null ?
Service.create(this.wsdlDocumentUrl, getQName(this.serviceName), this.serviceFeatures) :
Service.create(getQName(this.serviceName), this.serviceFeatures));
}
else {
service = (this.wsdlDocumentUrl != null ?
Service.create(this.wsdlDocumentUrl, getQName(this.serviceName)) :
Service.create(getQName(this.serviceName)));
}
if (this.executor != null) {
service.setExecutor(this.executor);
}
if (this.handlerResolver != null) {
service.setHandlerResolver(this.handlerResolver);
}
return service;
}
示例2: addVersionInformationToClient
import javax.xml.ws.Service; //导入方法依赖的package包/类
/**
* This method adds a version SOAP Handler into the handler chain of a web
* service. The version SOAP Handler is responsible to add a version
* information in the header of the outbound SOAP message.
*
* @param service
* set HandlerResolver for service by invoking service
* <code>setHandlerResolver</code> method.
* @return service with handler chain for handling version information.
*/
public Service addVersionInformationToClient(Service service) {
service.setHandlerResolver(new HandlerResolver() {
@SuppressWarnings("rawtypes")
@Override
public List<Handler> getHandlerChain(PortInfo portInfo) {
List<Handler> handlerList = new ArrayList<Handler>();
handlerList.add(new VersionHandler(version));
return handlerList;
}
});
return service;
}