当前位置: 首页>>代码示例>>Java>>正文


Java JaxWsProxyFactoryBean.setServiceClass方法代码示例

本文整理汇总了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();
}
 
开发者ID:esig,项目名称:dss-demonstrations,代码行数:19,代码来源:SignatureSoapServiceIT.java

示例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();
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:20,代码来源:ClientConfig.java

示例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);
    }
 
开发者ID:Fosstrak,项目名称:fosstrak-epcis,代码行数:22,代码来源:QuerySubscription.java

示例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();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:18,代码来源:CxfClient.java

示例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();
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:21,代码来源:ClientConfig.java

示例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);
}
 
开发者ID:Witerium,项目名称:stuffEngine,代码行数:17,代码来源:Main2.java

示例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;
	}
 
开发者ID:fpompermaier,项目名称:onvif,代码行数:26,代码来源:OnvifDevice.java

示例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();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:18,代码来源:ClientConfig.java

示例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();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:17,代码来源:HelloWorldClientImpl.java

示例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;

}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:19,代码来源:OleUuidCheckWebservice_UT.java

示例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();
}
 
开发者ID:glowroot,项目名称:glowroot,代码行数:25,代码来源:InvokeJaxwsWebServiceInTomcat.java

示例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);
}
 
开发者ID:apache,项目名称:servicemix,代码行数:18,代码来源:Client.java

示例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());
}
 
开发者ID:danielkennedy,项目名称:cf-buildpack-mule,代码行数:27,代码来源:BookstoreTestCase.java

示例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);
}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:27,代码来源:ZMQConduitTest.java

示例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;
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:19,代码来源:DorianSoapClientFactory.java


注:本文中的org.apache.cxf.jaxws.JaxWsProxyFactoryBean.setServiceClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。