@Test public void testInvokeReturnsValidXml() throws IOException { MessageContext messageContext = new MessageContext(new AxisClient()); messageContext.setRequestMessage(requestMessage); messageContext.setProperty(MessageContext.TRANS_URL, mockHttpServer.getServerUrl()); SoapResponseXmlProvider.getTestSoapResponse(API_VERSION); mockHttpServer.setMockResponse( new MockResponse(SoapResponseXmlProvider.getTestSoapResponse(API_VERSION))); httpHandler.invoke(messageContext); assertNotNull( "SOAP envelope of response is null", messageContext.getResponseMessage().getSOAPEnvelope()); }
@Override public void invoke(MessageContext msgContext) throws AxisFault { if (msgContext == null) { throw AxisFault.makeFault(new NullPointerException("Null message context")); } try { HttpResponse response = null; HttpRequest postRequest = createHttpRequest(msgContext); response = postRequest.execute(); msgContext.setResponseMessage(createResponseMessage(response)); } catch (RuntimeException | SOAPException | IOException e) { throw AxisFault.makeFault(e); } }
HttpHandler extends BasicHandler implements HttpRequestInitializer { @Override public void invoke(MessageContext msgContext) throws AxisFault { if (msgContext == null) { throw AxisFault.makeFault(new NullPointerException("Null message context")); } try { HttpResponse response = null; HttpRequest postRequest = createHttpRequest(msgContext); response = postRequest.execute(); msgContext.setResponseMessage(createResponseMessage(response)); } catch (RuntimeException | SOAPException | IOException e) { throw AxisFault.makeFault(e); } } }
HttpHandler extends BasicHandler implements HttpRequestInitializer { @Override public void invoke(MessageContext msgContext) throws AxisFault { if (msgContext == null) { throw AxisFault.makeFault(new NullPointerException("Null message context")); } try { HttpResponse response = null; HttpRequest postRequest = createHttpRequest(msgContext); response = postRequest.execute(); msgContext.setResponseMessage(createResponseMessage(response)); } catch (RuntimeException | SOAPException | IOException e) { throw AxisFault.makeFault(e); } } HttpHandler(); @VisibleForTesting  HttpHandler(HttpTransport transport, InputStreamEventListener inputStreamEventListener); }
HttpHandler extends BasicHandler implements HttpRequestInitializer { @Override public void invoke(MessageContext msgContext) throws AxisFault { if (msgContext == null) { throw AxisFault.makeFault(new NullPointerException("Null message context")); } try { HttpResponse response = null; HttpRequest postRequest = createHttpRequest(msgContext); response = postRequest.execute(); msgContext.setResponseMessage(createResponseMessage(response)); } catch (RuntimeException | SOAPException | IOException e) { throw AxisFault.makeFault(e); } } HttpHandler(); @VisibleForTesting  HttpHandler(HttpTransport transport, InputStreamEventListener inputStreamEventListener); @Override void invoke(MessageContext msgContext); @Override void initialize(HttpRequest httpRequest); }
HttpHandler extends BasicHandler implements HttpRequestInitializer { @Override public void invoke(MessageContext msgContext) throws AxisFault { if (msgContext == null) { throw AxisFault.makeFault(new NullPointerException("Null message context")); } try { HttpResponse response = null; HttpRequest postRequest = createHttpRequest(msgContext); response = postRequest.execute(); msgContext.setResponseMessage(createResponseMessage(response)); } catch (RuntimeException | SOAPException | IOException e) { throw AxisFault.makeFault(e); } } HttpHandler(); @VisibleForTesting  HttpHandler(HttpTransport transport, InputStreamEventListener inputStreamEventListener); @Override void invoke(MessageContext msgContext); @Override void initialize(HttpRequest httpRequest);  }