use of org.apache.cxf.jaxws.MessageReplayObserver in project cxf by apache.
the class DispatchOpTest method testResolveOperationWithSource.
@Test
public void testResolveOperationWithSource() throws Exception {
ServiceImpl service = new ServiceImpl(getBus(), getClass().getResource(WSDL_RESOURCE), SERVICE_NAME, null);
Dispatch<Source> disp = service.createDispatch(PORT_NAME, Source.class, Service.Mode.PAYLOAD);
disp.getRequestContext().put(MessageContext.WSDL_OPERATION, OP_NAME);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ADDRESS);
d.setMessageObserver(new MessageReplayObserver(RESP_RESOURCE));
BindingOperationVerifier bov = new BindingOperationVerifier();
((DispatchImpl<?>) disp).getClient().getOutInterceptors().add(bov);
Document doc = StaxUtils.read(getResourceAsStream(REQ_RESOURCE));
DOMSource source = new DOMSource(doc);
Source res = disp.invoke(source);
assertNotNull(res);
BindingOperationInfo boi = bov.getBindingOperationInfo();
assertNotNull(boi);
assertEquals(OP_NAME, boi.getName());
}
use of org.apache.cxf.jaxws.MessageReplayObserver in project cxf by apache.
the class DispatchOpTest method testResolveOperationWithSourceAndWSA.
@Test
public void testResolveOperationWithSourceAndWSA() throws Exception {
ServiceImpl service = new ServiceImpl(getBus(), getClass().getResource(WSDL_RESOURCE), SERVICE_NAME, null, new AddressingFeature());
Dispatch<Source> disp = service.createDispatch(PORT_NAME, Source.class, Service.Mode.PAYLOAD);
disp.getRequestContext().put(MessageContext.WSDL_OPERATION, OP_NAME);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ADDRESS);
d.setMessageObserver(new MessageReplayObserver(RESP_RESOURCE));
BindingOperationVerifier bov = new BindingOperationVerifier();
((DispatchImpl<?>) disp).getClient().getOutInterceptors().add(bov);
Document doc = StaxUtils.read(getResourceAsStream(REQ_RESOURCE));
DOMSource source = new DOMSource(doc);
Source res = disp.invoke(source);
assertNotNull(res);
BindingOperationInfo boi = bov.getBindingOperationInfo();
assertNotNull(boi);
assertEquals(OP_NAME, boi.getName());
}
Aggregations