use of org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl in project cxf by apache.
the class JaxWsEndpointImpl method createJaxwsBinding.
final void createJaxwsBinding() {
if (getBinding() instanceof SoapBinding) {
jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding(), this);
MTOMFeature mtomFeature = getMTOMFeature();
if (mtomFeature != null && mtomFeature.isEnabled()) {
((SOAPBinding) jaxwsBinding).setMTOMEnabled(true);
}
} else if (getBinding() instanceof XMLBinding) {
jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding(), this);
} else {
// REVISIT: Should not get here, though some bindings like JBI
// did not implement their own Binding type.
jaxwsBinding = new DefaultBindingImpl(this);
}
}
use of org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl in project cxf by apache.
the class ClientMtomXopTest method createPort.
private <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface, boolean enableMTOM, boolean installInterceptors) throws Exception {
ReflectionServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
Bus bus = getStaticBus();
LoggingFeature lf = new LoggingFeature();
lf.setPrettyLogging(false);
lf.setLogBinary(false);
lf.setLogMultipart(true);
bus.getFeatures().add(lf);
serviceFactory.setBus(bus);
serviceFactory.setServiceName(serviceName);
serviceFactory.setServiceClass(serviceEndpointInterface);
serviceFactory.setWsdlURL(ClientMtomXopTest.class.getResource("/wsdl/mtom_xop.wsdl"));
Service service = serviceFactory.create();
EndpointInfo ei = service.getEndpointInfo(portName);
JaxWsEndpointImpl jaxwsEndpoint = new JaxWsEndpointImpl(bus, service, ei);
SOAPBinding jaxWsSoapBinding = new SOAPBindingImpl(ei.getBinding(), jaxwsEndpoint);
jaxWsSoapBinding.setMTOMEnabled(enableMTOM);
if (installInterceptors) {
// jaxwsEndpoint.getBinding().getInInterceptors().add(new TestMultipartMessageInterceptor());
jaxwsEndpoint.getBinding().getOutInterceptors().add(new TestAttachmentOutInterceptor());
}
jaxwsEndpoint.getBinding().getInInterceptors().add(new LoggingInInterceptor());
jaxwsEndpoint.getBinding().getOutInterceptors().add(new LoggingOutInterceptor());
Client client = new ClientImpl(bus, jaxwsEndpoint);
InvocationHandler ih = new JaxWsClientProxy(client, jaxwsEndpoint.getJaxwsBinding());
Object obj = Proxy.newProxyInstance(serviceEndpointInterface.getClassLoader(), new Class[] { serviceEndpointInterface, BindingProvider.class }, ih);
updateAddressPort(obj, PORT);
return serviceEndpointInterface.cast(obj);
}
Aggregations