本文整理汇总了Java中org.apache.cxf.jaxws.JaxWsClientFactoryBean类的典型用法代码示例。如果您正苦于以下问题:Java JaxWsClientFactoryBean类的具体用法?Java JaxWsClientFactoryBean怎么用?Java JaxWsClientFactoryBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JaxWsClientFactoryBean类属于org.apache.cxf.jaxws包,在下文中一共展示了JaxWsClientFactoryBean类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setup
import org.apache.cxf.jaxws.JaxWsClientFactoryBean; //导入依赖的package包/类
public void setup(Class<?> serviceClass, String wsUrl) {
JaxWsClientFactoryBean factory = new JaxWsClientFactoryBean();
factory.setServiceClass(serviceClass);
factory.setAddress(wsUrl);
client = factory.create();
operationNames = new HashMap<String, String>();
Method[] methods = serviceClass.getMethods();
for (Method method : methods) {
if (method.isAnnotationPresent(WebMethod.class)) {
WebMethod webMethodAnnotation = method.getAnnotation(WebMethod.class);
if (!webMethodAnnotation.operationName().equals("")) {
operationNames.put(method.getName(), webMethodAnnotation.operationName());
continue;
}
}
operationNames.put(method.getName(), method.getName());
}
}
开发者ID:mnip91,项目名称:proactive-component-monitoring,代码行数:20,代码来源:JaxWsCXFWSCaller.java
示例2: setupHandlers
import org.apache.cxf.jaxws.JaxWsClientFactoryBean; //导入依赖的package包/类
protected void setupHandlers(ClientFactoryBean factoryBean, Client client)
throws Exception {
if (factoryBean instanceof JaxWsClientFactoryBean && handlers != null) {
AnnotationHandlerChainBuilder
builder = new AnnotationHandlerChainBuilder();
Method m = factoryBean.getClass().getMethod("getServiceFactory");
JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)m.invoke(factoryBean);
@SuppressWarnings("rawtypes")
List<Handler> chain = new ArrayList<Handler>(handlers);
chain.addAll(builder.buildHandlerChainFromClass(sf.getServiceClass(),
sf.getEndpointInfo().getName(),
sf.getServiceQName(),
factoryBean.getBindingId()));
if (!chain.isEmpty()) {
ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
resourceManager = new DefaultResourceManager(resolvers);
resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
ResourceInjector injector = new ResourceInjector(resourceManager);
for (Handler<?> h : chain) {
if (Proxy.isProxyClass(h.getClass()) && getServiceClass() != null) {
injector.inject(h, getServiceClass());
injector.construct(h, getServiceClass());
} else {
injector.inject(h);
injector.construct(h);
}
}
}
((JaxWsEndpointImpl)client.getEndpoint()).getJaxwsBinding().setHandlerChain(chain);
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:37,代码来源:CxfEndpoint.java
示例3: main
import org.apache.cxf.jaxws.JaxWsClientFactoryBean; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = HelloWorldService.class.getResource("client.xml");
Bus bus = bf.createBus(busFile.toString());
HelloWorldService hws = new HelloWorldService();
HelloWorld port = hws.getHelloWorldPort();
port.sayHello("Ramesh Reddy..");
JaxWsClientFactoryBean instance = new JaxWsClientFactoryBean();
Configurer configurer = bus.getExtension(Configurer.class);
configurer.configureBean(HelloWorldPort.toString() + ".jaxws-client.proxyFactory", instance); //$NON-NLS-1$
SpringBusFactory.setDefaultBus(bus);
SpringBusFactory.setThreadDefaultBus(bus);
Service svc = Service.create(SERVICE);
svc.addPort(HelloWorldPort, SOAPBinding.SOAP11HTTP_BINDING, "http://primary.example.com:8080/kerberos/HelloWorld");
Dispatch<StreamSource> dispatch = svc.createDispatch(HelloWorldPort, StreamSource.class, Mode.PAYLOAD);
Client client = ((DispatchImpl)dispatch).getClient();
Endpoint ep = client.getEndpoint();
ep.putAll(instance.getProperties());
ep.getOutInterceptors().addAll(instance.getOutInterceptors());
//ep.getActiveFeatures().addAll(instance.getFeatures());
ep.getInFaultInterceptors().addAll(instance.getInFaultInterceptors());
ep.getInInterceptors().addAll(instance.getInInterceptors());
ep.getOutFaultInterceptors().addAll(instance.getOutFaultInterceptors());
dispatch.getRequestContext().putAll(instance.getProperties());
StreamSource source = new StreamSource(new StringReader("<tns:sayHello xmlns:tns=\"http://webservices.samples.jboss.org/\"><arg0 xmlns=\"\">ramesh</arg0></tns:sayHello>")); //$NON-NLS-1$
StreamSource result = dispatch.invoke(source);
source.getInputStream().close();
bus.shutdown(true);
}
开发者ID:rareddy,项目名称:ws-security-examples,代码行数:41,代码来源:HelloWorldService.java
示例4: createConnectionFactory
import org.apache.cxf.jaxws.JaxWsClientFactoryBean; //导入依赖的package包/类
@SuppressWarnings("serial")
@Override
public BasicConnectionFactory<WSConnectionImpl> createConnectionFactory() throws ResourceException {
if (this.endPointName == null) {
this.endPointName = WSManagedConnectionFactory.DEFAULT_LOCAL_NAME;
}
if (this.serviceName == null) {
this.serviceName = WSManagedConnectionFactory.DEFAULT_LOCAL_NAME;
}
if (this.namespaceUri == null) {
this.namespaceUri = WSManagedConnectionFactory.DEFAULT_NAMESPACE_URI;
}
this.portQName = new QName(this.namespaceUri, this.endPointName);
this.serviceQName = new QName(this.namespaceUri, this.serviceName);
if (this.wsdl != null) {
try {
this.wsdlUrl = new URL(this.wsdl);
} catch (MalformedURLException e) {
File f = new File(this.wsdl);
try {
this.wsdlUrl = f.toURI().toURL();
} catch (MalformedURLException e1) {
throw new InvalidPropertyException(e1);
}
}
}
if (this.configFile != null) {
this.bus = new SpringBusFactory().createBus(this.configFile);
JaxWsClientFactoryBean instance = new JaxWsClientFactoryBean();
if (this.wsdl == null) {
Configurer configurer = this.bus.getExtension(Configurer.class);
if (null != configurer) {
configurer.configureBean(this.portQName.toString() + ".jaxws-client.proxyFactory", instance); //$NON-NLS-1$
}
this.outInterceptors = instance.getOutInterceptors();
}
}
return new BasicConnectionFactory<WSConnectionImpl>() {
@Override
public WSConnectionImpl getConnection() throws ResourceException {
return new WSConnectionImpl(WSManagedConnectionFactory.this);
}
};
}
开发者ID:kenweezy,项目名称:teiid,代码行数:45,代码来源:WSManagedConnectionFactory.java
示例5: CXFConnectorProxy
import org.apache.cxf.jaxws.JaxWsClientFactoryBean; //导入依赖的package包/类
public CXFConnectorProxy() {
this.client = new JaxWsClientFactoryBean();
}
开发者ID:v-drinkup,项目名称:alpaca,代码行数:4,代码来源:CXFConnectorProxy.java
注:本文中的org.apache.cxf.jaxws.JaxWsClientFactoryBean类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论