本文整理汇总了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");
}
}
示例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);
}
示例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;
}