@Test public void testNormal() { createClient(configurationContext).sendRequestTo("/axis2/services/TestService", withMessage("request.xml")).andExpect(message("response.xml")); }
public ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator) { try { Assert.notNull(requestCreator, "'requestCreator' must not be null"); WebServiceMessage requestMessage = requestCreator.createRequest(messageFactory); MessageContext messageContext = new DefaultMessageContext(requestMessage, messageFactory); interceptingTemplate.interceptRequest(messageContext, new WebServiceMessageReceiver() { public void receive(MessageContext messageContext) throws Exception { ByteArrayOutputStream response = new ByteArrayOutputStream(); InputStream request = getSourceAsStream(getEnvelopeSource(messageContext.getRequest())); receiver.processMessage(createMessageContext(action, to), request, response); messageContext.setResponse(messageFactory.createWebServiceMessage(new ByteArrayInputStream(response.toByteArray()))); } }); return new MockWebServiceClientResponseActions(messageContext); } catch (Exception e) { AssertionErrors.fail(e.getMessage()); return null; } }
Axis2MockWebServiceClient { public ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator) { try { Assert.notNull(requestCreator, "'requestCreator' must not be null"); WebServiceMessage requestMessage = requestCreator.createRequest(messageFactory); MessageContext messageContext = new DefaultMessageContext(requestMessage, messageFactory); interceptingTemplate.interceptRequest(messageContext, new WebServiceMessageReceiver() { public void receive(MessageContext messageContext) throws Exception { ByteArrayOutputStream response = new ByteArrayOutputStream(); InputStream request = getSourceAsStream(getEnvelopeSource(messageContext.getRequest())); receiver.processMessage(createMessageContext(action, to), request, response); messageContext.setResponse(messageFactory.createWebServiceMessage(new ByteArrayInputStream(response.toByteArray()))); } }); return new MockWebServiceClientResponseActions(messageContext); } catch (Exception e) { AssertionErrors.fail(e.getMessage()); return null; } } }
Axis2MockWebServiceClient { public ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator) { try { Assert.notNull(requestCreator, "'requestCreator' must not be null"); WebServiceMessage requestMessage = requestCreator.createRequest(messageFactory); MessageContext messageContext = new DefaultMessageContext(requestMessage, messageFactory); interceptingTemplate.interceptRequest(messageContext, new WebServiceMessageReceiver() { public void receive(MessageContext messageContext) throws Exception { ByteArrayOutputStream response = new ByteArrayOutputStream(); InputStream request = getSourceAsStream(getEnvelopeSource(messageContext.getRequest())); receiver.processMessage(createMessageContext(action, to), request, response); messageContext.setResponse(messageFactory.createWebServiceMessage(new ByteArrayInputStream(response.toByteArray()))); } }); return new MockWebServiceClientResponseActions(messageContext); } catch (Exception e) { AssertionErrors.fail(e.getMessage()); return null; } } Axis2MockWebServiceClient(WebServiceMessageFactory messageFactory, ConfigurationContext configurationContext, ClientInterceptor[] interceptors);  Axis2MockWebServiceClient(ConfigurationContext configurationContext, ClientInterceptor[] interceptors); }
Axis2MockWebServiceClient { public ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator) { try { Assert.notNull(requestCreator, "'requestCreator' must not be null"); WebServiceMessage requestMessage = requestCreator.createRequest(messageFactory); MessageContext messageContext = new DefaultMessageContext(requestMessage, messageFactory); interceptingTemplate.interceptRequest(messageContext, new WebServiceMessageReceiver() { public void receive(MessageContext messageContext) throws Exception { ByteArrayOutputStream response = new ByteArrayOutputStream(); InputStream request = getSourceAsStream(getEnvelopeSource(messageContext.getRequest())); receiver.processMessage(createMessageContext(action, to), request, response); messageContext.setResponse(messageFactory.createWebServiceMessage(new ByteArrayInputStream(response.toByteArray()))); } }); return new MockWebServiceClientResponseActions(messageContext); } catch (Exception e) { AssertionErrors.fail(e.getMessage()); return null; } } Axis2MockWebServiceClient(WebServiceMessageFactory messageFactory, ConfigurationContext configurationContext, ClientInterceptor[] interceptors);  Axis2MockWebServiceClient(ConfigurationContext configurationContext, ClientInterceptor[] interceptors); ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator); ResponseActions sendRequestTo(String serviceAddress, RequestCreator requestCreator); }
Axis2MockWebServiceClient { public ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator) { try { Assert.notNull(requestCreator, "'requestCreator' must not be null"); WebServiceMessage requestMessage = requestCreator.createRequest(messageFactory); MessageContext messageContext = new DefaultMessageContext(requestMessage, messageFactory); interceptingTemplate.interceptRequest(messageContext, new WebServiceMessageReceiver() { public void receive(MessageContext messageContext) throws Exception { ByteArrayOutputStream response = new ByteArrayOutputStream(); InputStream request = getSourceAsStream(getEnvelopeSource(messageContext.getRequest())); receiver.processMessage(createMessageContext(action, to), request, response); messageContext.setResponse(messageFactory.createWebServiceMessage(new ByteArrayInputStream(response.toByteArray()))); } }); return new MockWebServiceClientResponseActions(messageContext); } catch (Exception e) { AssertionErrors.fail(e.getMessage()); return null; } } Axis2MockWebServiceClient(WebServiceMessageFactory messageFactory, ConfigurationContext configurationContext, ClientInterceptor[] interceptors);  Axis2MockWebServiceClient(ConfigurationContext configurationContext, ClientInterceptor[] interceptors); ResponseActions sendRequestTo(final EndpointReference to, final String action, RequestCreator requestCreator); ResponseActions sendRequestTo(String serviceAddress, RequestCreator requestCreator);  }