本文整理汇总了Java中org.apache.cxf.jaxws.JaxWsProxyFactoryBean.setServiceClass方法的典型用法代码示例。如果您正苦于以下问题:Java JaxWsProxyFactoryBean.setServiceClass方法的具体用法?Java JaxWsProxyFactoryBean.setServiceClass怎么用?Java JaxWsProxyFactoryBean.setServiceClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.jaxws.JaxWsProxyFactoryBean
的用法示例。
在下文中一共展示了JaxWsProxyFactoryBean.setServiceClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Before
public void init() {
Map<String, Object> props = new HashMap<String, Object>();
props.put("mtom-enabled", Boolean.TRUE);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(SoapDocumentSignatureService.class);
factory.setProperties(props);
factory.setAddress(getBaseCxf() + CXFConfig.SOAP_SIGNATURE_ONE_DOCUMENT);
soapClient = (SoapDocumentSignatureService) factory.create();
JaxWsProxyFactoryBean factory2 = new JaxWsProxyFactoryBean();
factory2.setServiceClass(SoapMultipleDocumentsSignatureService.class);
factory2.setProperties(props);
factory2.setAddress(getBaseCxf() + CXFConfig.SOAP_SIGNATURE_MULTIPLE_DOCUMENTS);
soapMultiDocsClient = (SoapMultipleDocumentsSignatureService) factory2.create();
}
示例2: ticketAgentProxy
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Bean(name = "ticketAgentProxy")
public TicketAgent ticketAgentProxy() {
JaxWsProxyFactoryBean jaxWsProxyFactoryBean =
new JaxWsProxyFactoryBean();
jaxWsProxyFactoryBean.setServiceClass(TicketAgent.class);
jaxWsProxyFactoryBean.setAddress(address);
// add an interceptor to log the outgoing request messages
jaxWsProxyFactoryBean.getOutInterceptors()
.add(loggingOutInterceptor());
// add an interceptor to log the incoming response messages
jaxWsProxyFactoryBean.getInInterceptors()
.add(loggingInInterceptor());
// add an interceptor to log the incoming fault messages
jaxWsProxyFactoryBean.getInFaultInterceptors()
.add(loggingInInterceptor());
return (TicketAgent) jaxWsProxyFactoryBean.create();
}
示例3: executePoll
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
/**
* Poll a query using local transport.
*/
protected QueryResults executePoll(Poll poll) throws ImplementationExceptionResponse,
QueryTooComplexExceptionResponse, QueryTooLargeExceptionResponse, SecurityExceptionResponse,
ValidationExceptionResponse, NoSuchNameExceptionResponse, QueryParameterExceptionResponse {
// we use CXF's local transport feature here
// EPCglobalEPCISService service = new EPCglobalEPCISService();
// QName portName = new QName("urn:epcglobal:epcis:wsdl:1", "EPCglobalEPCISServicePortLocal");
// service.addPort(portName, "http://schemas.xmlsoap.org/soap/", "local://query");
// EPCISServicePortType servicePort = service.getPort(portName, EPCISServicePortType.class);
// the same using CXF API
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("local://query");
factory.setServiceClass(EPCISServicePortType.class);
EPCISServicePortType servicePort = (EPCISServicePortType)
factory.create();
return servicePort.poll(poll);
}
示例4: helloWorldjaxWsProxyFactoryBean
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Bean(name = "helloWorldJaxWsProxyBean")
public HelloWorldPortType helloWorldjaxWsProxyFactoryBean() {
JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
jaxWsProxyFactoryBean.setServiceClass(HelloWorldPortType.class);
jaxWsProxyFactoryBean.setAddress(environment
.getProperty("helloworld.address"));
jaxWsProxyFactoryBean.setBus(bus());
// set the user name for basic authentication
jaxWsProxyFactoryBean.setUsername(environment
.getProperty("client.username"));
// set the password for basic authentication
jaxWsProxyFactoryBean.setPassword(environment
.getProperty("client.password"));
return (HelloWorldPortType) jaxWsProxyFactoryBean.create();
}
示例5: ticketAgent
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Bean(name = "ticketAgentProxyBean")
public TicketAgent ticketAgent() {
JaxWsProxyFactoryBean jaxWsProxyFactoryBean =
new JaxWsProxyFactoryBean();
jaxWsProxyFactoryBean.setServiceClass(TicketAgent.class);
jaxWsProxyFactoryBean.setAddress(address);
// add the WSS4J OUT interceptor to sign the request message
jaxWsProxyFactoryBean.getOutInterceptors().add(clientWssOut());
// add the WSS4J IN interceptor to verify the signature on the response message
jaxWsProxyFactoryBean.getInInterceptors().add(clientWssIn());
// log the request and response messages
jaxWsProxyFactoryBean.getInInterceptors()
.add(loggingInInterceptor());
jaxWsProxyFactoryBean.getOutInterceptors()
.add(loggingOutInterceptor());
return (TicketAgent) jaxWsProxyFactoryBean.create();
}
示例6: main
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public static void main(String[] args){
// You just need to set the address with JMS URI
String address = "jms:jndi:dynamicQueues/EmployeeQueue"
+ "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+ "&jndiConnectionFactoryName=ConnectionFactory"
+ "&jndiURL=tcp://localhost:61616";
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
// And specify the transport ID with SOAP over JMS specification
factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
factory.setServiceClass(EmployeeWebService.class);
factory.setAddress(address);
EmployeeWebService client = (EmployeeWebService)factory.create();
client.changePositionAsync(1,1);
System.out.println("changed");
System.exit(0);
}
示例7: getServiceProxy
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public static JaxWsProxyFactoryBean getServiceProxy(BindingProvider servicePort, String serviceAddr) {
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
if(serviceAddr != null)
proxyFactory.setAddress(serviceAddr);
proxyFactory.setServiceClass(servicePort.getClass());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SoapBindingConfiguration config = new SoapBindingConfiguration();
config.setVersion(Soap12.getInstance());
proxyFactory.setBindingConfig(config);
Client deviceClient = ClientProxy.getClient(servicePort);
HTTPConduit http = (HTTPConduit) deviceClient.getConduit();
// AuthorizationPolicy authPolicy = new AuthorizationPolicy();
// authPolicy.setUserName(username);
// authPolicy.setPassword(password);
// authPolicy.setAuthorizationType("Basic");
// http.setAuthorization(authPolicy);
HTTPClientPolicy httpClientPolicy = http.getClient();
httpClientPolicy.setConnectionTimeout(36000);
httpClientPolicy.setReceiveTimeout(32000);
httpClientPolicy.setAllowChunking(false);
return proxyFactory;
}
示例8: ticketAgent
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Bean(name = "ticketAgentProxyBean")
public TicketAgent ticketAgent() {
JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
jaxWsProxyFactoryBean.setServiceClass(TicketAgent.class);
jaxWsProxyFactoryBean.setAddress(address);
// add the WSS4J OUT interceptor to sign the request message
jaxWsProxyFactoryBean.getOutInterceptors().add(clientWssOut());
// add the WSS4J IN interceptor to verify the signature on the response message
jaxWsProxyFactoryBean.getInInterceptors().add(clientWssIn());
// log the request and response messages
jaxWsProxyFactoryBean.getInInterceptors().add(logIn());
jaxWsProxyFactoryBean.getOutInterceptors().add(logOut());
return (TicketAgent) jaxWsProxyFactoryBean.create();
}
示例9: HelloWorldClientImpl
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public HelloWorldClientImpl() throws IOException {
// load the CXF properties file that contains the endpoint address
Properties cxfProperties = loadProperties("/cxf.properties");
/* create a Java proxy to call the Hello World service */
// create a JaxWsProxyFactoryBean
JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
// set the Hello World service class
jaxWsProxyFactoryBean.setServiceClass(HelloWorldPortType.class);
// set the endpoint address
jaxWsProxyFactoryBean.setAddress(cxfProperties
.getProperty("helloworld.address"));
// create the Java proxy
this.helloWorldJaxWsProxy = (HelloWorldPortType) jaxWsProxyFactoryBean
.create();
}
示例10: getService
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public Object getService() {
try {
clientFactory = new JaxWsProxyFactoryBean();
clientFactory.setServiceClass(Class.forName("org.kuali.ole.service.OleUuidCheckWebService"));
} catch (ClassNotFoundException e) {
LOG.error("Failed to connect to soap service because failed to load interface class: ", e);
}
QName namespaceURI = new QName("http://service.select.ole.kuali.org/", "oleUuidCheckWebService");
clientFactory.setServiceName(namespaceURI);
String serviceURL = "";//ConfigContext.getCurrentContextConfig().getProperty("uuidCheckServiceURL");
LOG.info(" uuidCheckServiceURL --------> " + serviceURL);
clientFactory.setAddress(serviceURL);
Object service = clientFactory.create();
LOG.info("<<<< service >>>> " + service);
return service;
}
示例11: executeApp
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public void executeApp(String webapp, String contextPath, String url) throws Exception {
int port = getAvailablePort();
Tomcat tomcat = new Tomcat();
tomcat.setBaseDir("target/tomcat");
tomcat.setPort(port);
Context context = tomcat.addWebapp(contextPath,
new File("src/test/resources/" + webapp).getAbsolutePath());
WebappLoader webappLoader =
new WebappLoader(InvokeJaxwsWebServiceInTomcat.class.getClassLoader());
context.setLoader(webappLoader);
tomcat.start();
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(ForBothHelloAndRootService.class);
factory.setAddress("http://localhost:" + port + contextPath + url);
ForBothHelloAndRootService client = (ForBothHelloAndRootService) factory.create();
client.echo("abc");
checkForRequestThreads(webappLoader);
tomcat.stop();
tomcat.destroy();
}
示例12: sendRequest
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public void sendRequest() throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(HelloWorld.class);
factory.setAddress("http://localhost:8181/cxf/HelloWorldSecurity");
HelloWorld client = (HelloWorld) factory.create();
Map<String, Object> outProps = new HashMap<String, Object>();
outProps.put("action", "UsernameToken");
//add a CustomerSecurityInterceptor for client side to init wss4j staff
//retrieve and set user/password, users can easily add this interceptor
//through spring configuration also
ClientProxy.getClient(client).getOutInterceptors().add(new CustomerSecurityInterceptor());
ClientProxy.getClient(client).getOutInterceptors().add(new WSS4JOutInterceptor());
String ret = client.sayHi("ffang");
System.out.println(ret);
}
示例13: testOrderBook
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testOrderBook()
{
// Catalog web service
JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
pf.setServiceClass(CatalogService.class);
pf.setAddress(CatalogService.URL);
CatalogService catalog = (CatalogService) pf.create();
assertNotNull(catalog);
// Order web service
JaxWsProxyFactoryBean pf2 = new JaxWsProxyFactoryBean();
pf2.setServiceClass(OrderService.class);
pf2.setAddress(OrderService.URL);
OrderService orderService = (OrderService) pf2.create();
assertNotNull(orderService);
// Place an order for book #3 from the catalog
Book book = catalog.getBook(3);
assertNotNull(book);
Order order = orderService.orderBook(book, 2, "Somewhere", "[email protected]");
assertNotNull(order);
assertEquals(3, order.getBook().getId());
assertEquals(2, order.getQuantity());
assertEquals("[email protected]", order.getEmail());
}
示例14: testConfigurationFromWSDL
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testConfigurationFromWSDL() throws Exception {
new Thread(new Runnable() {
@Override
public void run() {
ZMQ.Socket zmqSocket = zmqContext.socket(ZMQ.REP);
zmqSocket.bind("tcp://*:" + ZMQ_TEST_PORT);
byte[] request = zmqSocket.recv(0);
try {
XMLAssert.assertXMLEqual(FileUtils.readFileToString(new File(getClass().getResource("/samples/soap-request.xml").toURI())), new String(request));
zmqSocket.send(FileUtils.readFileToString(new File(getClass().getResource("/samples/soap-reply.xml").toURI())));
} catch (Exception e) {
throw new RuntimeException(e);
}
zmqSocket.close();
}
}).start();
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(HelloWorldPortType.class);
factory.setWsdlLocation("/wsdl/zmq_test.wsdl");
HelloWorldPortType client = (HelloWorldPortType) factory.create();
String reply = client.sayHello("Claude");
assertEquals("Hello Claude", reply);
}
示例15: createSoapClient
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public static DorianPortType createSoapClient(String url,
KeyStoreType truststore, KeyManager keyManager)
throws GeneralSecurityException, IOException {
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Configurer baseConf = bus.getExtension(Configurer.class);
SSLConfigurer sslConf = new SSLConfigurer(baseConf);
sslConf.setTruststore(truststore);
sslConf.setKm(new KeyManager[]{keyManager});
bus.setExtension(sslConf, Configurer.class);
JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean();
cf.setAddress(url);
cf.setServiceClass(DorianService.class);
cf.setBus(bus);
DorianPortType dorianPort = cf.create(DorianPortType.class);
return dorianPort;
}