use of org.apache.header_test.TestHeaderImpl in project cxf by apache.
the class HeaderTest method testInvocation.
@Test
public void testInvocation() throws Exception {
JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
Bus bus = getBus();
bean.setBus(bus);
bean.setServiceClass(TestHeaderImpl.class);
Service service = bean.create();
OperationInfo op = service.getServiceInfos().get(0).getInterface().getOperation(new QName(service.getName().getNamespaceURI(), "testHeader5"));
assertNotNull(op);
List<MessagePartInfo> parts = op.getInput().getMessageParts();
assertEquals(1, parts.size());
MessagePartInfo part = parts.get(0);
assertNotNull(part.getTypeClass());
assertEquals(TestHeader5.class, part.getTypeClass());
parts = op.getOutput().getMessageParts();
assertEquals(2, parts.size());
part = parts.get(1);
assertNotNull(part.getTypeClass());
assertEquals(TestHeader5ResponseBody.class, part.getTypeClass());
part = parts.get(0);
assertNotNull(part.getTypeClass());
assertEquals(TestHeader5.class, part.getTypeClass());
// part = parts.get(1);
// assertNotNull(part.getTypeClass());
ServerFactoryBean svr = new ServerFactoryBean();
svr.setBus(bus);
svr.setServiceFactory(bean);
svr.setServiceBean(new TestHeaderImpl());
svr.setAddress("http://localhost:9104/SoapHeaderContext/SoapHeaderPort");
svr.setBindingConfig(new JaxWsSoapBindingConfiguration(bean));
svr.create();
Node response = invoke("http://localhost:9104/SoapHeaderContext/SoapHeaderPort", LocalTransportFactory.TRANSPORT_ID, "testHeader5.xml");
assertNotNull(response);
assertNoFault(response);
addNamespace("t", "http://apache.org/header_test/types");
assertValid("//s:Header/t:testHeader5", response);
}
use of org.apache.header_test.TestHeaderImpl in project cxf by apache.
the class HeaderClientServerTest method setUp.
@Before
public void setUp() throws Exception {
BusFactory.setDefaultBus(getBus());
Object implementor = new TestHeaderImpl();
String address = "http://localhost:9104/SoapHeaderContext/SoapHeaderPort";
endpoint = (EndpointImpl) Endpoint.publish(address, implementor);
implementor = new TestRPCHeaderImpl();
address = "http://localhost:9104/SoapHeaderRPCContext/SoapHeaderRPCPort";
rpcEndpoint = (EndpointImpl) Endpoint.publish(address, implementor);
}
Aggregations