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


Java JaxWsServerFactoryBean.setServiceBean方法代码示例

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


在下文中一共展示了JaxWsServerFactoryBean.setServiceBean方法的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 {
    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

示例6: 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

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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例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: Publish

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入方法依赖的package包/类
static void Publish()
{
    HelloWorldImpl implementor = new HelloWorldImpl();
    JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
    System.setProperties(applyNoLimits(System.getProperties()));
    svrFactory.setServiceClass(HelloWorld.class);
    svrFactory.setAddress(Address);
    svrFactory.setServiceBean(implementor);

    TransferInterceptor.addServerHook(svrFactory, new MyServerHook());
    TransferInterceptor.addServerHook(svrFactory,new MyLogHook());

    svrFactory.getInInterceptors().add(new LoggingInInterceptor());
    svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
    svrFactory.create();
    System.out.println("Published: " + implementor.getClass());
}
 
开发者ID:devizer,项目名称:jlab,代码行数:18,代码来源:ServerSide.java

示例14: before

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入方法依赖的package包/类
@Before
public void before() throws IOException {

    Port = FindAvailablePort();
    Address = String.format("http://localhost:%d/helloWorld", Port);
    System.out.println("New Test's Address: " + Address);

    // Create Server 'host'
    HelloWorldImpl implementor = new HelloWorldImpl();
    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
    System.setProperties(ServerSide.applyNoLimits(System.getProperties()));
    factory.setServiceClass(HelloWorld.class);
    factory.setAddress(Address);
    factory.setServiceBean(implementor);
    TransferInterceptor.addServerHook(factory, new MyServerHook());
    // factory.getInInterceptors().add(new LoggingInInterceptor());
    // factory.getOutInterceptors().add(new LoggingOutInterceptor());
    factory.create();
    svrFactory = factory;
}
 
开发者ID:devizer,项目名称:jlab,代码行数:21,代码来源:TestCxf.java

示例15: createServerEndpoint

import org.apache.cxf.jaxws.JaxWsServerFactoryBean; //导入方法依赖的package包/类
private static void createServerEndpoint() {
  // use a CXF JaxWsServerFactoryBean to create JAX-WS endpoints
  JaxWsServerFactoryBean jaxWsServerFactoryBean =
      new JaxWsServerFactoryBean();

  // set the HelloWorld implementation
  HelloWorldImpl implementor = new HelloWorldImpl();
  jaxWsServerFactoryBean.setServiceBean(implementor);

  // set the address at which the HelloWorld endpoint will be exposed
  jaxWsServerFactoryBean.setAddress(ENDPOINT_ADDRESS);

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


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