Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 8834 invoked from network); 5 Feb 2009 08:29:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Feb 2009 08:29:07 -0000 Received: (qmail 77940 invoked by uid 500); 5 Feb 2009 08:28:58 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 77926 invoked by uid 500); 5 Feb 2009 08:28:58 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 77917 invoked by uid 99); 5 Feb 2009 08:28:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 00:28:58 -0800 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.202.165.37] (HELO smtpauth13.prod.mesa1.secureserver.net) (64.202.165.37) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 05 Feb 2009 08:28:50 +0000 Received: (qmail 32219 invoked from network); 5 Feb 2009 08:28:27 -0000 Received: from unknown (217.132.161.69) by smtpauth13.prod.mesa1.secureserver.net (64.202.165.37) with ESMTP; 05 Feb 2009 08:28:25 -0000 From: "Yoav Naveh" To: References: <037001c9850b$834ac660$89e05320$@com> In-Reply-To: <037001c9850b$834ac660$89e05320$@com> Subject: RE: Getting all parameters of the request Date: Thu, 5 Feb 2009 10:28:21 +0200 Message-ID: <01c201c9876b$b633d370$229b7a50$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01C3_01C9877C.79BCA370" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcmFC4FdgDrgV2cMT4aHdgtLRvoIEQCX7anQ Content-Language: he X-Virus-Checked: Checked by ClamAV on apache.org This is a multipart message in MIME format. ------=_NextPart_000_01C3_01C9877C.79BCA370 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi Everyone, I managed to find a solution for this. In case anyone is interested, here it is: org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation(); envelope = msgContext.getEnvelope() Iterator iter = envelope.getBody().getFirstElement().getChildElements(); while(iter.hasNext()) { OMElement omElem = iter.next(); System.out.println(omElem.getText()); System.out.println(omElem.getQName().getLocalPart()); } Same can be done for the response parameters, by getting the envelope as such: envelope = toEnvelope(getSOAPFactory(msgContext), Response, false); From: Yoav Naveh [mailto:yoav@contextin.com] Sent: Monday, February 02, 2009 9:55 AM To: axis-user@ws.apache.org Subject: Getting all parameters of the request Hello, I would like to be able to log all the parameters given to my WS function. To do so in the most generic way, I was wondering if there is any way to iterate all input parameters from the MessageContext or anything similar. For example, suppose my WS exposes a function called test that receives 3 String parameters as input, I would like to print these variables and values to my log, without querying for them in the function implementation. Instead, I would like each exposed function's implementation call one utility function to extract all the fields. Does anyone know of a way to perform this? In addition, I would like to do something similar with the response (save all returned variables to a log file without function-specific implementation) Thanks! Yoav ------=_NextPart_000_01C3_01C9877C.79BCA370 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi = Everyone,

 

I managed to find a = solution for this. In case anyone is interested, here it is:

org.apache.axis2.description.AxisOperation op =3D msgContext.getOperationContext().getAxisOperation();

envelope =3D msgContext.getEnvelope()

Iterator<OMElement> = iter = =3D = envelope.getBody().getFirstElement().getChildElements= ();

while(iter.hasNext()) = {

OMElement = omElem = =3D = iter.next();

      = System.out.println(omElem.getText());

      = System.out.println(omElem.getQName().getLocalP= art());

}

 

Same can be done for = the response parameters, by getting the envelope as = such:

envelope =3D toEnvelope(getSOAPFactory(msgContext), <your_func_name>Response, = false);

 

From:= Yoav Naveh [mailto:yoav@contextin.com]
Sent: Monday, February 02, 2009 9:55 AM
To: axis-user@ws.apache.org
Subject: Getting all parameters of the = request

 

Hello,

 

I would like to be able to log all the parameters = given to my WS function.

To do so in the most generic way, I was wondering = if there is any way to iterate all input parameters from the MessageContext or = anything similar.

 

For example, suppose my WS exposes a function = called test that receives 3 String parameters as input,

I would like to print these variables and values to = my log, without querying for them in the function implementation.

Instead, I would like each exposed function's = implementation call one utility function to extract all the fields.

 

Does anyone know of a way to perform = this?

 

In addition, I would like to do something similar = with the response (save all returned variables to a log file without = function-specific implementation)

 

Thanks!

Yoav

------=_NextPart_000_01C3_01C9877C.79BCA370--