Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5979

Error while printing the SOAP Message Response (In)

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      I had created a client stub (jar) using the Axis 2. I need to consume this jar into my application and like wise print the soap request and response whenever a soap service is invoked. How do i do that ? While surfing on internet i only found the below approach to print the logs. But it only print the request . While printing the response it throws error " java.lang.IllegalStateException: Can't process next node because caching is disabled" . Please assist ?

      ServiceContext serviceContext = this.proxy._getServiceClient().getServiceContext();
      boolean cacheLastOperationContext = true;
      serviceContext.setCachingOperationContext(cacheLastOperationContext);
      OperationContext lastOperationContext = serviceContext.getLastOperationContext();
      lastOperationContext.setComplete(true);
      if(null != lastOperationContext) {
      MessageContext outMessageContext = lastOperationContext.getMessageContext("Out");
      MessageContext inMessageContext = lastOperationContext.getMessageContext("In");

      if (outMessageContext != null)

      { System.out.println("OUT SOAP: " + outMessageContext.getEnvelope().toString()); }

      if (inMessageContext != null)

      { ** This below line throws the error while printing the response** System.out.println("IN SOAP: "+ inMessageContext.getEnvelope().toString());  proxy.cleanup(); }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kulsingh0 kuldeep

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment