use of org.apache.cxf.service.model.BindingInfo in project cxf by apache.
the class XMLBindingFactoryTest method testContainsInAttachmentInterceptor.
@Test
public void testContainsInAttachmentInterceptor() {
XMLBindingFactory xbf = new XMLBindingFactory();
Binding b = xbf.createBinding(new BindingInfo(null, null));
boolean found = false;
for (Interceptor<? extends Message> interseptor : b.getInInterceptors()) {
if (interseptor instanceof AttachmentInInterceptor) {
found = true;
}
}
assertTrue("No in attachment interceptor found", found);
}
use of org.apache.cxf.service.model.BindingInfo in project cxf by apache.
the class ServiceModelVisitor method walk.
public void walk() {
begin(serviceInfo);
begin(serviceInfo.getInterface());
for (OperationInfo o : serviceInfo.getInterface().getOperations()) {
begin(o);
visitOperation(o);
end(o);
}
end(serviceInfo.getInterface());
for (EndpointInfo endpointInfo : serviceInfo.getEndpoints()) {
begin(endpointInfo);
end(endpointInfo);
}
for (BindingInfo bindingInfo : serviceInfo.getBindings()) {
begin(bindingInfo);
end(bindingInfo);
}
end(serviceInfo);
}
use of org.apache.cxf.service.model.BindingInfo in project cxf by apache.
the class SimpleMethodDispatcher method getBindingOperation.
public BindingOperationInfo getBindingOperation(Method method, Endpoint endpoint) {
Map<BindingInfo, BindingOperationInfo> bops = infoMap.get(method);
if (bops == null) {
return null;
}
BindingOperationInfo bop = bops.get(endpoint.getEndpointInfo().getBinding());
if (bop == null) {
OperationInfo o = methodToOp.get(method);
if (o == null) {
return null;
}
BindingInfo b = endpoint.getEndpointInfo().getBinding();
for (BindingOperationInfo bop2 : b.getOperations()) {
if (bop2.getOperationInfo().equals(o)) {
BindingOperationInfo realBop = getRealOperation(o, bop2);
bops.put(b, realBop);
return realBop;
}
}
}
return bop;
}
use of org.apache.cxf.service.model.BindingInfo in project cxf by apache.
the class AbstractWSDLBasedEndpointFactory method createBindingInfo.
protected BindingInfo createBindingInfo() {
BindingFactoryManager mgr = bus.getExtension(BindingFactoryManager.class);
String binding = bindingId;
if (binding == null && bindingConfig != null) {
binding = bindingConfig.getBindingId();
}
if (binding == null) {
// default to soap binding
binding = "http://schemas.xmlsoap.org/soap/";
}
try {
if (binding.contains("/soap")) {
if (bindingConfig == null) {
bindingConfig = createSoapBindingConfig();
}
if (bindingConfig instanceof SoapBindingConfiguration && !((SoapBindingConfiguration) bindingConfig).isSetStyle()) {
((SoapBindingConfiguration) bindingConfig).setStyle(serviceFactory.getStyle());
}
}
bindingFactory = mgr.getBindingFactory(binding);
BindingInfo inf = bindingFactory.createBindingInfo(serviceFactory.getService(), binding, bindingConfig);
for (BindingOperationInfo boi : inf.getOperations()) {
serviceFactory.updateBindingOperation(boi);
Method m = serviceFactory.getMethodDispatcher().getMethod(boi);
serviceFactory.sendEvent(FactoryBeanListener.Event.BINDING_OPERATION_CREATED, inf, boi, m);
}
serviceFactory.sendEvent(FactoryBeanListener.Event.BINDING_CREATED, inf);
return inf;
} catch (BusException ex) {
throw new ServiceConstructionException(new Message("COULD.NOT.RESOLVE.BINDING", LOG, bindingId), ex);
}
}
use of org.apache.cxf.service.model.BindingInfo in project cxf by apache.
the class CodeFirstTest method createService.
private Definition createService(boolean wrapped) throws Exception {
ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
Bus bus = getBus();
bean.setBus(bus);
bean.setServiceClass(Hello.class);
bean.setWrapped(wrapped);
Service service = bean.create();
InterfaceInfo i = service.getServiceInfos().get(0).getInterface();
assertEquals(5, i.getOperations().size());
ServerFactoryBean svrFactory = new ServerFactoryBean();
svrFactory.setBus(bus);
svrFactory.setServiceFactory(bean);
svrFactory.setAddress(address);
svrFactory.create();
Collection<BindingInfo> bindings = service.getServiceInfos().get(0).getBindings();
assertEquals(1, bindings.size());
ServiceWSDLBuilder wsdlBuilder = new ServiceWSDLBuilder(bus, service.getServiceInfos().get(0));
return wsdlBuilder.build();
}
Aggregations