From java-dev-return-97323-apmail-axis-java-dev-archive=axis.apache.org@axis.apache.org Fri Feb 21 20:16:03 2020 Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 470A01995B for ; Fri, 21 Feb 2020 20:16:03 +0000 (UTC) Received: (qmail 84119 invoked by uid 500); 21 Feb 2020 20:16:01 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 83969 invoked by uid 500); 21 Feb 2020 20:16:01 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 83955 invoked by uid 99); 21 Feb 2020 20:16:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Feb 2020 20:16:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 92AAFE0EAA for ; Fri, 21 Feb 2020 20:16:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 0C073780111 for ; Fri, 21 Feb 2020 20:16:00 +0000 (UTC) Date: Fri, 21 Feb 2020 20:16:00 +0000 (UTC) From: "kuldeep (Jira)" To: java-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AXIS2-5979) Error while printing the SOAP Message Response (In) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AXIS2-5979?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] kuldeep updated AXIS2-5979: --------------------------- Description:=20 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 w= henever a soap service is invoked. How do i do that ? While surfing on inte= rnet i only found the below approach to print the logs. But it only print t= he request . While printing the response it throws error " java.lang.Illega= lStateException: Can't process next node because caching is disabled" . Ple= ase assist ? ServiceContext serviceContext =3D this.proxy._getServiceClient().getService= Context(); boolean cacheLastOperationContext =3D true; serviceContext.setCachingOperationContext(cacheLastOperationContext); OperationContext lastOperationContext =3D serviceContext.getLastOperationC= ontext(); lastOperationContext.setComplete(true); if(null !=3D lastOperationContext) { MessageContext outMessageContext =3D lastOperationContext.getMessageContex= t("Out"); MessageContext inMessageContext =3D lastOperationContext.getMessageContext= ("In"); if (outMessageContext !=3D null) { System.out.println("OUT SOAP: " + outMessageContext.getEnvelope().toStrin= g()); } if (inMessageContext !=3D null) { ** This below line throws the error while printing the response** System.out.println("IN SOAP: "+ inMessageContext.getEnvelope().toString());= =C2=A0 proxy.cleanup(); } } was: 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 w= henever a soap service is invoked. How do i do that ? While surfing on inte= rnet i only found the below approach to print the logs. But it only print t= he request . While printing the response it throws error " java.lang.Illega= lStateException: Can't process next node because caching is disabled" . Ple= ase assist ? ServiceContext serviceContext =3D this.proxy._getServiceClient().getService= Context(); boolean cacheLastOperationContext =3D true; serviceContext.setCachingOperationContext(cacheLastOperationContext); OperationContext lastOperationContext =3D serviceContext.getLastOperationCo= ntext(); lastOperationContext.setComplete(true); if(null !=3D lastOperationContext) { MessageContext outMessageContext =3D lastOperationContext.getMessageContex= t("Out"); MessageContext inMessageContext =3D lastOperationContext.getMessageContext= ("In"); if (outMessageContext !=3D null) { System.out.println("OUT SOAP: " + outMessageContext.getEnvelope().toString= ()); } if (inMessageContext !=3D null) { ** This below line throws the error while printing the response** System.out.println("IN SOAP: "+ inMessageContext.getEnvelope().toString())= ;=C2=A0 proxy.cleanup(); } } > Error while printing the SOAP Message Response (In)=20 > ---------------------------------------------------- > > Key: AXIS2-5979 > URL: https://issues.apache.org/jira/browse/AXIS2-5979 > Project: Axis2 > Issue Type: Bug > Reporter: kuldeep > Priority: Major > Labels: Axis2 > > I had created a client stub (jar) using the Axis 2. I need to consume thi= s 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 in= ternet 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.Ille= galStateException: Can't process next node because caching is disabled" . P= lease assist ? > ServiceContext serviceContext =3D this.proxy._getServiceClient().getServi= ceContext(); > boolean cacheLastOperationContext =3D true; > serviceContext.setCachingOperationContext(cacheLastOperationContext); > OperationContext lastOperationContext =3D serviceContext.getLastOperatio= nContext(); > lastOperationContext.setComplete(true); > if(null !=3D lastOperationContext) { > MessageContext outMessageContext =3D lastOperationContext.getMessageCont= ext("Out"); > MessageContext inMessageContext =3D lastOperationContext.getMessageConte= xt("In"); > if (outMessageContext !=3D null) > { System.out.println("OUT SOAP: " + outMessageContext.getEnvelope().toStr= ing()); } > if (inMessageContext !=3D null) > { ** This below line throws the error while printing the response** > System.out.println("IN SOAP: "+ inMessageContext.getEnvelope().toString()= );=C2=A0 proxy.cleanup(); } > } -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org