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


Java JaxWsServerFactoryBean类代码示例

本文整理汇总了Java中org.apache.cxf.jaxws.JaxWsServerFactoryBean的典型用法代码示例。如果您正苦于以下问题:Java JaxWsServerFactoryBean类的具体用法?Java JaxWsServerFactoryBean怎么用?Java JaxWsServerFactoryBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JaxWsServerFactoryBean类属于org.apache.cxf.jaxws包,在下文中一共展示了JaxWsServerFactoryBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUpBeforeClass

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  // start the HelloWorld service using jaxWsServerFactoryBean
  JaxWsServerFactoryBean jaxWsServerFactoryBean =
      new JaxWsServerFactoryBean();

  // adding loggingFeature to print the received/sent messages
  LoggingFeature loggingFeature = new LoggingFeature();
  loggingFeature.setPrettyLogging(true);

  jaxWsServerFactoryBean.getFeatures().add(loggingFeature);

  // setting the implementation
  HelloWorldImpl implementor = new HelloWorldImpl();
  jaxWsServerFactoryBean.setServiceBean(implementor);
  // setting the endpoint
  jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);
  jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:20,代码来源:HelloWorldImplTest.java

示例2: createServerEndpoint

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
private static void createServerEndpoint() {
  JaxWsServerFactoryBean jaxWsServerFactoryBean =
      new JaxWsServerFactoryBean();

  // create the loggingFeature
  LoggingFeature loggingFeature = new LoggingFeature();
  loggingFeature.setPrettyLogging(true);

  // add the loggingFeature to print the received/sent messages
  jaxWsServerFactoryBean.getFeatures().add(loggingFeature);

  HelloWorldImpl implementor = new HelloWorldImpl();
  jaxWsServerFactoryBean.setServiceBean(implementor);
  jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

  jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:18,代码来源:HelloWorldImplTest.java

示例3: main

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
/**
 * 接口测试 wsdl: http://localhost:9000/wSSample?wsdl
 * @param args
 */
public static void main(String[] args) {
  System.out.println("web service 启动中。。。");
  WSSampleImpl implementor = new WSSampleImpl();
  String address = "http://192.168.245.221:9000/wSSample";
  if (TestEnv.onTTrue) {
    address = "http://localhost:9000/wSSample";
  }
  JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean();
  factoryBean.setAddress(address); // 设置地址
  factoryBean.setServiceClass(WSSample.class); // 接口类
  factoryBean.setServiceBean(implementor); // 设置实现类

  factoryBean.create(); // 创建webservice接口
  System.out.println("web service 启动成功。。");
}
 
开发者ID:MiniPa,项目名称:cjs_ssms,代码行数:20,代码来源:WSServerTest.java

示例4: setUp

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@Before
public void setUp() throws Exception {      
    
    template = context.createProducerTemplate();
    JaxWsServerFactoryBean svrBean = new JaxWsServerFactoryBean();
    svrBean.setAddress(getServerAddress());
    svrBean.setServiceClass(Greeter.class);
    svrBean.setServiceBean(new GreeterImpl());
    SpringBusFactory bf = new SpringBusFactory();
    URL cxfConfig = null;

    if (getCxfServerConfig() != null) {
        cxfConfig = ClassLoaderUtils.getResource(getCxfServerConfig(), this.getClass());
    }
    svrBean.setBus(bf.createBus(cxfConfig));
    serviceEndpoint = svrBean.create();

}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:WSAddressingTest.java

示例5: setUpBeforeClass

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    // start the HelloWorld service using jaxWsServerFactoryBean
    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();

    // adding loggingFeature to print the received/sent messages
    LoggingFeature loggingFeature = new LoggingFeature();
    loggingFeature.setPrettyLogging(true);

    jaxWsServerFactoryBean.getFeatures().add(loggingFeature);

    // setting the implementation
    HelloWorldImpl implementor = new HelloWorldImpl();
    jaxWsServerFactoryBean.setServiceBean(implementor);
    // setting the endpoint
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);
    jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:19,代码来源:HelloWorldImplTest.java

示例6: setUpBeforeClass

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();
    jaxWsServerFactoryBean.setServiceBean(new HelloWorldServerImplMock());
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

    Properties properties = System.getProperties();
    // set the 'java.security.auth.login.config' property with the location
    // of the JAAS login configuration
    properties.setProperty("java.security.auth.login.config",
            "./src/test/resources/jaas-login.conf");
    // create a JAASLoginInterceptor to enable authentication
    JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
    // set the context to lookup from 'java.security.auth.login.config'
    jaasLoginInterceptor.setContextName("jaasContext");
    // add the JAASLoginInterceptor to the server
    jaxWsServerFactoryBean.getInInterceptors().add(jaasLoginInterceptor);

    jaxWsServerFactoryBean.create();

    helloWorldClientImpl = new HelloWorldClientImpl(
            new HelloWorldBusImpl().getBus());
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:24,代码来源:HelloWorldClientImplTest.java

示例7: setUpBeforeClass

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    Properties properties = System.getProperties();
    // set the 'java.security.auth.login.config' property with the location
    // of the JAAS login configuration
    properties.setProperty("java.security.auth.login.config",
            "./src/test/resources/jaas-login.conf");

    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();
    jaxWsServerFactoryBean.setServiceBean(new HelloWorldEndpointImpl());
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

    LoggingFeature loggingFeature = new LoggingFeature();
    loggingFeature.setPrettyLogging(true);
    jaxWsServerFactoryBean.getFeatures().add(loggingFeature);

    // create a JAASLoginInterceptor to enable authentication
    JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
    // set the context to lookup from 'java.security.auth.login.config'
    jaasLoginInterceptor.setContextName("jaasContext");
    // add the JAASLoginInterceptor to the server
    jaxWsServerFactoryBean.getInInterceptors().add(jaasLoginInterceptor);

    jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:26,代码来源:HelloWorldEndpointImplTest.java

示例8: setUpBeforeClass

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    Properties properties = System.getProperties();
    // set the location of the 'java.security.auth.login.config'
    properties.setProperty("java.security.auth.login.config",
            "./src/test/resources/jaas-login.conf");

    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();
    jaxWsServerFactoryBean.setServiceBean(new HelloWorldServerImplMock());
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

    // create a JAASLoginInterceptor to enable authentication
    JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
    // set the context to lookup from 'java.security.auth.login.config'
    jaasLoginInterceptor.setContextName("jaasContext");
    // add the JAASLoginInterceptor to the server
    jaxWsServerFactoryBean.getInInterceptors().add(jaasLoginInterceptor);

    jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:21,代码来源:HelloWorldClientImplTest.java

示例9: setUpBeforeClass

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
    Properties properties = System.getProperties();
    // set the 'java.security.auth.login.config' property with the location
    // of the JAAS login configuration
    properties.setProperty("java.security.auth.login.config",
            "./src/test/resources/jaas-login.conf");

    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();
    jaxWsServerFactoryBean.setServiceBean(new HelloWorldServerImplMock());
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

    // create a JAASLoginInterceptor to enable authentication
    JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
    // set the context to lookup from 'java.security.auth.login.config'
    jaasLoginInterceptor.setContextName("jaasContext");
    // add the JAASLoginInterceptor to the server
    jaxWsServerFactoryBean.getInInterceptors().add(jaasLoginInterceptor);

    jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:22,代码来源:HelloWorldClientImplTest.java

示例10: createServerEndpoint

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
private static void createServerEndpoint() {
    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();

    // create the loggingFeature
    LoggingFeature loggingFeature = new LoggingFeature();
    loggingFeature.setPrettyLogging(true);

    // adding loggingFeature to print the received/sent messages
    jaxWsServerFactoryBean.getFeatures().add(loggingFeature);

    HelloWorldImpl implementor = new HelloWorldImpl();
    jaxWsServerFactoryBean.setServiceBean(implementor);
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

    jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:17,代码来源:HelloWorldClientTest.java

示例11: createServerEndpoint

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
private static void createServerEndpoint() {
    JaxWsServerFactoryBean jaxWsServerFactoryBean = new JaxWsServerFactoryBean();

    // create the loggingFeature
    LoggingFeature loggingFeature = new LoggingFeature();
    loggingFeature.setPrettyLogging(true);

    // add the loggingFeature to print the received/sent messages
    jaxWsServerFactoryBean.getFeatures().add(loggingFeature);

    HelloWorldImpl implementor = new HelloWorldImpl();
    jaxWsServerFactoryBean.setServiceBean(implementor);
    jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

    jaxWsServerFactoryBean.create();
}
 
开发者ID:code-not-found,项目名称:jaxws-cxf,代码行数:17,代码来源:HelloWorldImplTest.java

示例12: createLocalJaxWsService

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
/**
	 * 构造服务,注意要自己释放
	 * @param intf
	 * @param bean
	 * @return
	 */
	private Server createLocalJaxWsService(Class<?> intf, Object bean) {
		String url = "local://" + intf.getName();
		ServiceDefinition ws = getFactory().processServiceDef(new ServiceDefinition(intf.getSimpleName(),intf,bean));
		if (ws == null)
			return null;
		JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean(new CXFPlusServiceFactoryBean());
		sf.setAddress(url);
		sf.setServiceBean(ws.getServiceBean());
		sf.setServiceClass(ws.getServiceClass());
		if (printTrace()){
			sf.getInInterceptors().add(new LoggingInInterceptor());
			sf.getOutInterceptors().add(new LoggingOutInterceptor());
//			sf.getHandlers().add(TraceHandler.getSingleton());
		}
		Server server = sf.create();
		return server;
	}
 
开发者ID:GeeQuery,项目名称:cxf-plus,代码行数:24,代码来源:CXFTestBase.java

示例13: testDecoupledEndpoint

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@Test
public void testDecoupledEndpoint() throws Exception {

    JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
    serverFactory.setAddress("zmq:(tcp://*:" + ZMQ_TEST_PORT + "?socketOperation=bind&socketType=pull)");
    serverFactory.setServiceClass(HelloWorldImpl.class);
    Server server = serverFactory.create();

    JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
    clientFactory.setServiceClass(HelloWorldPortType.class);
    clientFactory.setAddress("zmq:(tcp://localhost:" + ZMQ_TEST_PORT + "?socketOperation=connect&socketType=push)");
    clientFactory.getFeatures().add(new WSAddressingFeature());

    HelloWorldPortType client = (HelloWorldPortType) clientFactory.create();

    ClientProxy.getClient(client).getEndpoint()
                                 .getEndpointInfo()
                                 .setProperty("org.apache.cxf.ws.addressing.replyto",
                                              "zmq:(tcp://127.0.0.1:5555?socketOperation=connect&socketType=push)");

    String reply = client.sayHello("Claude");

    server.stop();

    assertEquals("Hello Claude", reply);
}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:27,代码来源:ZMQConduitTest.java

示例14: testConfigurationFromAPI

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@Test
public void testConfigurationFromAPI() throws Exception {

    JaxWsServerFactoryBean bean = new JaxWsServerFactoryBean();
    bean.setAddress("zmq:(tcp://*:" + ZMQ_TEST_PORT + "?socketOperation=bind&socketType=rep)");
    bean.setServiceClass(HelloWorldImpl.class);
    Server server = bean.create();

    ZMQ.Socket zmqSocket = zmqContext.socket(ZMQ.REQ);
    zmqSocket.connect("tcp://localhost:" + ZMQ_TEST_PORT);
    zmqSocket.send(FileUtils.readFileToString(new File(getClass().getResource("/samples/soap-request.xml").toURI())).getBytes(), 0);
    byte[] reply = zmqSocket.recv(0);
    zmqSocket.close();

    server.stop();

    XMLAssert.assertXMLEqual(FileUtils.readFileToString(new File(getClass().getResource("/samples/soap-reply.xml").toURI())), new String(reply));
}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:19,代码来源:ZMQDestinationTest.java

示例15: testConfigurationFromWSDL

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入依赖的package包/类
@Test
public void testConfigurationFromWSDL() throws Exception {
    JaxWsServerFactoryBean bean = new JaxWsServerFactoryBean();
    bean.setWsdlLocation("/wsdl/zmq_test.wsdl");
    bean.setServiceClass(HelloWorldImpl.class);
    Server server = bean.create();

    ZMQ.Socket zmqSocket = zmqContext.socket(ZMQ.REQ);
    zmqSocket.connect("tcp://localhost:" + ZMQ_TEST_PORT);
    zmqSocket.send(FileUtils.readFileToString(new File(getClass().getResource("/samples/soap-request.xml").toURI())).getBytes(), 0);
    byte[] reply = zmqSocket.recv(0);
    zmqSocket.close();

    server.stop();

    XMLAssert.assertXMLEqual(FileUtils.readFileToString(new File(getClass().getResource("/samples/soap-reply.xml").toURI())), new String(reply));
}
 
开发者ID:claudemamo,项目名称:cxf-rt-transports-zeromq,代码行数:18,代码来源:ZMQDestinationTest.java


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