@Test public void testCaptureServiceAndOperationNames() throws Exception { when(mockSoapMessageContext.get(MessageContext.WSDL_SERVICE)) .thenReturn(wsdlService); when(mockSoapMessageContext.getMessage()).thenReturn(mockMessage); when(mockMessage.getSOAPBody()).thenReturn(mockSoapBody); when(mockSoapBody.getFirstChild()).thenReturn(firstChild); when(firstChild.getLocalName()).thenReturn(OPERATION_LOCAL_NAME); jaxWsSoapContextHandler.captureServiceAndOperationNames(mockSoapMessageContext); RequestInfo requestInfo = jaxWsSoapContextHandler.getLastRequestInfoBuilder().build(); assertEquals(wsdlService.getLocalPart(), requestInfo.getServiceName()); assertEquals(OPERATION_LOCAL_NAME, requestInfo.getMethodName()); }
@VisibleForTesting void captureServiceAndOperationNames(SOAPMessageContext context) { lastRequestInfo.withServiceName( ((QName) context.get(MessageContext.WSDL_SERVICE)).getLocalPart()); String lastOperationCalled; try { lastOperationCalled = context.getMessage().getSOAPBody().getFirstChild().getLocalName(); } catch (SOAPException e) { lastOperationCalled = ""; } lastRequestInfo.withMethodName(lastOperationCalled); }
JaxWsSoapContextHandler implements SOAPHandler<SOAPMessageContext> { @VisibleForTesting void captureServiceAndOperationNames(SOAPMessageContext context) { lastRequestInfo.withServiceName( ((QName) context.get(MessageContext.WSDL_SERVICE)).getLocalPart()); String lastOperationCalled; try { lastOperationCalled = context.getMessage().getSOAPBody().getFirstChild().getLocalName(); } catch (SOAPException e) { lastOperationCalled = ""; } lastRequestInfo.withMethodName(lastOperationCalled); } }
JaxWsSoapContextHandler implements SOAPHandler<SOAPMessageContext> { @VisibleForTesting void captureServiceAndOperationNames(SOAPMessageContext context) { lastRequestInfo.withServiceName( ((QName) context.get(MessageContext.WSDL_SERVICE)).getLocalPart()); String lastOperationCalled; try { lastOperationCalled = context.getMessage().getSOAPBody().getFirstChild().getLocalName(); } catch (SOAPException e) { lastOperationCalled = ""; } lastRequestInfo.withMethodName(lastOperationCalled); } @Inject  JaxWsSoapContextHandler(
      RequestInfoXPathSet requestInfoXPathSet,
      ResponseInfoXPathSet responseInfoXPathSet); }
JaxWsSoapContextHandler implements SOAPHandler<SOAPMessageContext> { @VisibleForTesting void captureServiceAndOperationNames(SOAPMessageContext context) { lastRequestInfo.withServiceName( ((QName) context.get(MessageContext.WSDL_SERVICE)).getLocalPart()); String lastOperationCalled; try { lastOperationCalled = context.getMessage().getSOAPBody().getFirstChild().getLocalName(); } catch (SOAPException e) { lastOperationCalled = ""; } lastRequestInfo.withMethodName(lastOperationCalled); } @Inject  JaxWsSoapContextHandler(
      RequestInfoXPathSet requestInfoXPathSet,
      ResponseInfoXPathSet responseInfoXPathSet); @Override boolean handleMessage(SOAPMessageContext context); @Override boolean handleFault(SOAPMessageContext context); RequestInfo.Builder getLastRequestInfoBuilder(); ResponseInfo.Builder getLastResponseInfoBuilder(); void addHeader(String namespace, String headerName, SOAPElement headerValue); void clearHeaders(); Set<SOAPElement> getAddedHeaders(); @Override Set<QName> getHeaders(); @Override void close(MessageContext messageContext); }
JaxWsSoapContextHandler implements SOAPHandler<SOAPMessageContext> { @VisibleForTesting void captureServiceAndOperationNames(SOAPMessageContext context) { lastRequestInfo.withServiceName( ((QName) context.get(MessageContext.WSDL_SERVICE)).getLocalPart()); String lastOperationCalled; try { lastOperationCalled = context.getMessage().getSOAPBody().getFirstChild().getLocalName(); } catch (SOAPException e) { lastOperationCalled = ""; } lastRequestInfo.withMethodName(lastOperationCalled); } @Inject  JaxWsSoapContextHandler(
      RequestInfoXPathSet requestInfoXPathSet,
      ResponseInfoXPathSet responseInfoXPathSet); @Override boolean handleMessage(SOAPMessageContext context); @Override boolean handleFault(SOAPMessageContext context); RequestInfo.Builder getLastRequestInfoBuilder(); ResponseInfo.Builder getLastResponseInfoBuilder(); void addHeader(String namespace, String headerName, SOAPElement headerValue); void clearHeaders(); Set<SOAPElement> getAddedHeaders(); @Override Set<QName> getHeaders(); @Override void close(MessageContext messageContext);  }