use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.
the class MustUnderstandInterceptorTest method testHandleMessageWithSoapHeader11Param.
@Test
public void testHandleMessageWithSoapHeader11Param() throws Exception {
prepareSoapMessage("test-soap-header.xml");
dsi.getUnderstoodHeaders().add(RESERVATION);
ServiceInfo serviceInfo = getMockedServiceModel(getClass().getResource("test-soap-header.wsdl").toString());
BindingInfo binding = serviceInfo.getBinding(new QName("http://org.apache.cxf/headers", "headerTesterSOAPBinding"));
BindingOperationInfo bop = binding.getOperation(new QName("http://org.apache.cxf/headers", "inHeader"));
soapMessage.getExchange().put(BindingOperationInfo.class, bop);
soapMessage.getInterceptorChain().doIntercept(soapMessage);
assertTrue("DummaySoapInterceptor getRoles has been called!", dsi.isCalledGetRoles());
assertTrue("DummaySoapInterceptor getUnderstood has been called!", dsi.isCalledGetUnderstood());
}
use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.
the class RPCInInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
ServiceInfo si = getMockedServiceModel(this.getClass().getResource("/wsdl_soap/hello_world_rpc_lit.wsdl").toString());
BindingInfo bi = si.getBinding(new QName(TNS, "Greeter_SOAPBinding_RPCLit"));
BindingOperationInfo boi = bi.getOperation(new QName(TNS, OPNAME));
boi.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(MyComplexStruct.class);
boi.getOperationInfo().getInput().getMessagePartByIndex(0).setIndex(1);
boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(MyComplexStruct.class);
boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(0);
soapMessage.getExchange().put(BindingOperationInfo.class, boi);
control.reset();
Service service = control.createMock(Service.class);
JAXBDataBinding dataBinding = new JAXBDataBinding(MyComplexStruct.class);
service.getDataBinding();
EasyMock.expectLastCall().andReturn(dataBinding).anyTimes();
service.getServiceInfos();
List<ServiceInfo> list = Arrays.asList(si);
EasyMock.expectLastCall().andReturn(list).anyTimes();
EasyMock.expect(service.isEmpty()).andReturn(true).anyTimes();
soapMessage.getExchange().put(Service.class, service);
soapMessage.getExchange().put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.FALSE);
control.replay();
}
use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.
the class SoapActionInterceptorTest method createBindingOperation.
private BindingOperationInfo createBindingOperation() {
ServiceInfo s = new ServiceInfo();
InterfaceInfo ii = s.createInterface(new QName("FooInterface"));
s.setInterface(ii);
ii.addOperation(new QName("fooOp"));
BindingInfo b = new BindingInfo(s, "foo");
return b.buildOperation(new QName("fooOp"), null, null);
}
use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.
the class TestBase method getTestService.
protected BindingInfo getTestService(String wsdlUrl, String port) throws Exception {
ServiceInfo service = getMockedServiceModel(getClass().getResource(wsdlUrl).toString());
assertNotNull(service);
BindingInfo binding = service.getEndpoint(new QName(service.getName().getNamespaceURI(), port)).getBinding();
assertNotNull(binding);
return binding;
}
use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.
the class RPCOutInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
ServiceInfo si = getMockedServiceModel(this.getClass().getResource("/wsdl_soap/hello_world_rpc_lit.wsdl").toString());
BindingInfo bi = si.getBinding(new QName(TNS, "Greeter_SOAPBinding_RPCLit"));
BindingOperationInfo boi = bi.getOperation(new QName(TNS, OPNAME));
boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(0);
soapMessage.getExchange().put(BindingOperationInfo.class, boi);
control.reset();
Service service = control.createMock(Service.class);
EasyMock.expect(service.isEmpty()).andReturn(true).anyTimes();
JAXBDataBinding dataBinding = new JAXBDataBinding(MyComplexStruct.class);
service.getDataBinding();
EasyMock.expectLastCall().andReturn(dataBinding).anyTimes();
service.getServiceInfos();
List<ServiceInfo> list = Arrays.asList(si);
EasyMock.expectLastCall().andReturn(list).anyTimes();
soapMessage.getExchange().put(Service.class, service);
soapMessage.getExchange().put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.FALSE);
control.replay();
MyComplexStruct mcs = new MyComplexStruct();
mcs.setElem1("elem1");
mcs.setElem2("elem2");
mcs.setElem3(45);
MessageContentsList param = new MessageContentsList();
param.add(mcs);
soapMessage.setContent(List.class, param);
}
Aggregations