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


Java SoapBindingFactory类代码示例

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


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

示例1: begin

import org.apache.cxf.binding.soap.SoapBindingFactory; //导入依赖的package包/类
@Override
public void begin(ServiceInfo service) {
    BindingInfo xml = null;
    for (BindingInfo bindingInfo : service.getBindings()) {
        if (SoapBindingConstants.SOAP11_BINDING_ID.equals(bindingInfo.getBindingId())
                || SoapBindingConstants.SOAP12_BINDING_ID.equals(bindingInfo.getBindingId())
                || SoapBindingFactory.SOAP_11_BINDING.equals(bindingInfo.getBindingId())
                || SoapBindingFactory.SOAP_12_BINDING.equals(bindingInfo.getBindingId())
                ) {
            SoapBindingInfo sbi = (SoapBindingInfo) bindingInfo;
            if (WSDLConstants.NS_SOAP11_HTTP_TRANSPORT.equals(sbi.getTransportURI())
                    || WSDLConstants.NS_SOAP12_HTTP_BINDING.equals(sbi.getTransportURI())
                    || "http://cxf.apache.org/transports/local".equals(sbi.getTransportURI())) {
                soapBindingInfo = sbi;
                break;
            }
        } else if (WSDLConstants.NS_BINDING_XML.equals(bindingInfo.getBindingId())) {
            xml = bindingInfo;
        }
    }

    // For now, we use soap if its available, and XML if it isn't.\
    if (soapBindingInfo == null && xml == null) {
        throw new UnsupportedConstruct("NO_USABLE_BINDING");
    }
}
 
开发者ID:selckin,项目名称:cxf-php-soap-codegen,代码行数:27,代码来源:ServicePHPBuilder.java

示例2: getTheBusInstance

import org.apache.cxf.binding.soap.SoapBindingFactory; //导入依赖的package包/类
@Test
public void getTheBusInstance() {
    Bus bus = ctx.getBean("cxfBus", Bus.class);
    assertNotNull("The bus should not be null", bus);
    
    bus = ctx.getBean("myBus", Bus.class);
    assertNotNull("The bus should not be null", bus);

    SoapBindingFactory soapBindingFactory = bus.getExtension(SoapBindingFactory.class);
    assertNotNull("You should find the factory here", soapBindingFactory);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:12,代码来源:SpringBusFactoryBeanTest.java

示例3: start

import org.apache.cxf.binding.soap.SoapBindingFactory; //导入依赖的package包/类
@Override
public void start() throws Exception {
	if ( isStartup() ) {
		return ;
	}
	ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
	Bus bus;
	try {
		Thread.currentThread().setContextClassLoader( BusFactory.class.getClassLoader() );
		bus = BusFactory.newInstance().createBus();
		client.setBus( bus );
	} finally {
		Thread.currentThread().setContextClassLoader( oldCL );
	}
	final SoapBindingFactory sfb = new SoapBindingFactory();
	sfb.setActivationNamespaces( WsConstants.ACTIVATION_NAMESPACES );
	sfb.setBus( bus );
	client.setBindingFactory( sfb );
	final SoapTransportFactory stf =  new SoapTransportFactory();
	stf.setTransportIds( WsConstants.SERVER_HTTP_TRANSPORT_IDS );
	stf.setBus( bus );
	client.setDestinationFactory( stf );
	final WsRequestConfig request = ( ( WsRequestConfig ) getConfig().getRequest() );
	client.setAddress( request.getUri() );
	if ( request.getResource() == null || "".equals( request.getResource() ) ) {
		throw new IllegalArgumentException(  );
	}
	final String resource = request.getResource();
	final Class< ? > clazz = Class.forName( resource, false, this.getClass().getClassLoader() );
	client.setServiceClass( clazz );
	client.getInInterceptors().add( new LoggingInInterceptor() );
	client.getOutInterceptors().add( new LoggingOutInterceptor() );
	proxy = client.create();
	running = true;
}
 
开发者ID:v-drinkup,项目名称:alpaca,代码行数:36,代码来源:CXFConnectorProxy.java


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