You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shehan Simen <ss...@itree.com.au> on 2008/07/11 03:38:28 UTC

How to print axis2 request and response

Hi,
I want to save the web service request/response to the database as a string or blob.
How can I implement the request.toString() and response.toString() methods?
I am using axis2 and wsdl2java code generation.
I don't want to play with the generated code.
Is there an easier way to do this, without mucking around with soap envelop and other more detailed technical stuff?

thx

Re: How to print axis2 request and response

Posted by Heshan Suriyaarachchi <he...@gmail.com>.
Hi Shehan,
       Let me add some more to what the other guys have said.You first need
to understand the handler concept in Axis2. Articles [1], [2] will help you
to get an understanding on how to use handlers to  add some functionality.
An example of writing a module can be found in Axis2 samples. You can find
it here [3]. I think with some small alterations to [3] , you might be able
to get the functionality you want.

[1] - http://ws.apache.org/axis2/1_4/Axis2ArchitectureGuide.html#bmSOAPPM
[2] - http://www.developer.com/java/web/article.php/3529321
[3] -
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/userguide/src/userguide/loggingmodule/


On Mon, Jul 14, 2008 at 3:42 PM, Charitha Kankanamge <ch...@wso2.com>
wrote:

> Hi,
> http://ws.apache.org/axis2/1_4/modules.html will help you to get some
> understanding on writing a module to log messages.
>
> regards
> Charitha
>
>
> Shehan Simen wrote:
>
>  Hi Amila,
>>
>> Is there any tutorial for writing axis2 handler?
>>
>> I have no idea about the module.xml
>>
>>
>> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
>> *Sent:* Monday, 14 July 2008 4:17 PM
>> *To:* axis-user@ws.apache.org
>> *Subject:* Re: How to print axis2 request and response
>>
>>
>> you can write an Axis2 Handler to log the soap message. and then put this
>> handler to inflow and outflow using a module.xml. This means you have to
>> write Axis2 module and engage it your service.
>>
>> thanks,
>> Amila.
>>
>> On Fri, Jul 11, 2008 at 2:13 AM, Shehan Simen <ssimen@itree.com.au<mailto:
>> ssimen@itree.com.au>> wrote:
>>
>> Hi Eran,
>>
>> Yes, I was able to capture it successfully inside the
>> XXXXMessageReceiverInOut.class generated by wsdl2java.
>>
>> Thankx for your help.
>>
>>
>> Regards,
>>
>> simen
>>
>>
>> *From:* Shehan Simen [mailto:ssimen@itree.com.au <mailto:
>> ssimen@itree.com.au>]
>> *Sent:* Friday, 11 July 2008 3:29 PM
>>
>>
>> *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>>
>> *Subject:* RE: How to print axis2 request and response
>>
>>
>> Thank you Eran,
>>
>> Yes, I am the service author and I am thinking to put this inside the
>> service implementation.
>>
>> I like to do this in more high level, rather than digging into complex
>> code inside axis.
>>
>> I use the code generated by wsdl2java.
>>
>> I don't see anything like MessageContext. It may be more deeper inside
>> axis2.
>>
>> Is there any simpler way to do this?
>>
>> Please help me.
>>
>>
>> Regards,
>>
>> Simen
>>
>>
>> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com <mailto:
>> eran.chinthaka@gmail.com>]
>> *Sent:* Friday, 11 July 2008 3:15 PM
>> *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>> *Subject:* Re: How to print axis2 request and response
>>
>>
>> MessageContext messageContext = MessageContext.getCurrentMessageContext();
>> String request = messageContext.getEnvelope().toString();
>>
>> The above code will give you the SOAP message in the current message
>> context. If you use the above code in the in flow, you will get the request
>> message and you will get the response message if you put the above code in
>> outflow.
>>
>> Are you the service author and are you thinking of putting this code,
>> inside your service implementation class?
>>
>> There is another way of doing this operation context, but I need above
>> info to give a better answer.
>>
>> On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ssimen@itree.com.au<mailto:
>> ssimen@itree.com.au>> wrote:
>>
>> Hi Eran,
>>
>> As I am developing the web service, I have the access to all the objects
>> from the server side.
>>
>> How can I save the incoming soap requests and outgoing soap response
>> messages to the database?
>>
>> I want to save everything which is going through the wire. (or at least
>> part of it as a xml message)
>>
>> Please send me a helpful reply.
>>
>>
>> Thank you.
>>
>> Simen
>>
>>
>> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com <mailto:
>> eran.chinthaka@gmail.com>]
>> *Sent:* Friday, 11 July 2008 2:19 PM
>> *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>> *Subject:* Re: How to print axis2 request and response
>>
>>
>> Will you have access to request and response objects? If you are using
>> Axis2 war app, unless you like to get ur hands wet, I don't see a way to do
>> that.
>>
>> On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ssimen@itree.com.au<mailto:
>> ssimen@itree.com.au>> wrote:
>>
>> Hi,
>>
>> I want to save the web service request/response to the database as a
>> string or blob.
>>
>> How can I implement the request.toString() and response.toString()
>> methods?
>>
>> I am using axis2 and wsdl2java code generation.
>>
>> I don't want to play with the generated code.
>>
>> Is there an easier way to do this, without mucking around with soap
>> envelop and other more detailed technical stuff?
>>
>>
>> thx
>>
>>
>>
>>
>> --
>> With Mettha,
>> Eran Chinthaka
>>
>> --------------------------------------------------------------------
>> Health is the greatest gift; contentment is the greatest wealth; trusting
>> is the best relationship; nirvana is the highest joy. - Dhammapada
>>
>>
>>
>>
>> --
>> With Mettha,
>> Eran Chinthaka
>>
>> --------------------------------------------------------------------
>> Health is the greatest gift; contentment is the greatest wealth; trusting
>> is the best relationship; nirvana is the highest joy. - Dhammapada
>>
>>
>>
>>
>> --
>> Amila Suriarachchi,
>> WSO2 Inc.
>>
>> ------------------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG. Version: 7.5.524 / Virus Database: 270.4.7/1543 - Release
>> Date: 7/9/2008 6:32 PM
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Regards,
Heshan Suriyaarachchi

http://heshans.blogspot.com/

Re: How to print axis2 request and response

Posted by Charitha Kankanamge <ch...@wso2.com>.
Hi,
http://ws.apache.org/axis2/1_4/modules.html will help you to get some 
understanding on writing a module to log messages.

regards
Charitha


Shehan Simen wrote:

> Hi Amila,
>
> Is there any tutorial for writing axis2 handler?
>
> I have no idea about the module.xml
>
>  
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* Monday, 14 July 2008 4:17 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: How to print axis2 request and response
>
>  
>
> you can write an Axis2 Handler to log the soap message. and then put 
> this handler to inflow and outflow using a module.xml. This means you 
> have to write Axis2 module and engage it your service.
>
> thanks,
> Amila.
>
> On Fri, Jul 11, 2008 at 2:13 AM, Shehan Simen <ssimen@itree.com.au 
> <ma...@itree.com.au>> wrote:
>
> Hi Eran,
>
> Yes, I was able to capture it successfully inside the 
> XXXXMessageReceiverInOut.class generated by wsdl2java.
>
> Thankx for your help.
>
>  
>
> Regards,
>
> simen
>
>  
>
> *From:* Shehan Simen [mailto:ssimen@itree.com.au 
> <ma...@itree.com.au>]
> *Sent:* Friday, 11 July 2008 3:29 PM
>
>
> *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
>
> *Subject:* RE: How to print axis2 request and response
>
>  
>
> Thank you Eran,
>
> Yes, I am the service author and I am thinking to put this inside the 
> service implementation.
>
> I like to do this in more high level, rather than digging into complex 
> code inside axis.
>
> I use the code generated by wsdl2java.
>
> I don't see anything like MessageContext. It may be more deeper inside 
> axis2.
>
> Is there any simpler way to do this?
>
> Please help me.
>
>  
>
> Regards,
>
> Simen
>
>  
>
> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com 
> <ma...@gmail.com>]
> *Sent:* Friday, 11 July 2008 3:15 PM
> *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
> *Subject:* Re: How to print axis2 request and response
>
>  
>
> MessageContext messageContext = MessageContext.getCurrentMessageContext();
> String request = messageContext.getEnvelope().toString();
>
> The above code will give you the SOAP message in the current message 
> context. If you use the above code in the in flow, you will get the 
> request message and you will get the response message if you put the 
> above code in outflow.
>
> Are you the service author and are you thinking of putting this code, 
> inside your service implementation class?
>
> There is another way of doing this operation context, but I need above 
> info to give a better answer.
>
> On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ssimen@itree.com.au 
> <ma...@itree.com.au>> wrote:
>
> Hi Eran,
>
> As I am developing the web service, I have the access to all the 
> objects from the server side.
>
> How can I save the incoming soap requests and outgoing soap response 
> messages to the database?
>
> I want to save everything which is going through the wire. (or at 
> least part of it as a xml message)
>
> Please send me a helpful reply.
>
>  
>
> Thank you.
>
> Simen
>
>  
>
> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com 
> <ma...@gmail.com>]
> *Sent:* Friday, 11 July 2008 2:19 PM
> *To:* axis-user@ws.apache.org <ma...@ws.apache.org>
> *Subject:* Re: How to print axis2 request and response
>
>  
>
> Will you have access to request and response objects? If you are using 
> Axis2 war app, unless you like to get ur hands wet, I don't see a way 
> to do that.
>
> On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ssimen@itree.com.au 
> <ma...@itree.com.au>> wrote:
>
> Hi,
>
> I want to save the web service request/response to the database as a 
> string or blob.
>
> How can I implement the request.toString() and response.toString() 
> methods?
>
> I am using axis2 and wsdl2java code generation.
>
> I don't want to play with the generated code.
>
> Is there an easier way to do this, without mucking around with soap 
> envelop and other more detailed technical stuff?
>
>  
>
> thx
>
>
>
>
> -- 
> With Mettha,
> Eran Chinthaka
>
> --------------------------------------------------------------------
> Health is the greatest gift; contentment is the greatest wealth; 
> trusting is the best relationship; nirvana is the highest joy. - 
> Dhammapada
>
>
>
>
> -- 
> With Mettha,
> Eran Chinthaka
>
> --------------------------------------------------------------------
> Health is the greatest gift; contentment is the greatest wealth; 
> trusting is the best relationship; nirvana is the highest joy. - 
> Dhammapada
>
>
>
>
> -- 
> Amila Suriarachchi,
> WSO2 Inc.
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG. 
>Version: 7.5.524 / Virus Database: 270.4.7/1543 - Release Date: 7/9/2008 6:32 PM
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: How to print axis2 request and response

Posted by Enaganti M Naidu <em...@hotmail.com>.
Look at the logging module sample....but it is very primitive....I can share a better example later if you still need it...

From: ssimen@itree.com.auTo: axis-user@ws.apache.orgDate: Mon, 14 Jul 2008 16:19:35 +1000Subject: RE: How to print axis2 request and response




Hi Amila,
Is there any tutorial for writing axis2 handler?
I have no idea about the module.xml
 

From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com] Sent: Monday, 14 July 2008 4:17 PMTo: axis-user@ws.apache.orgSubject: Re: How to print axis2 request and response
 
you can write an Axis2 Handler to log the soap message. and then put this handler to inflow and outflow using a module.xml. This means you have to write Axis2 module and engage it your service. thanks,Amila.

On Fri, Jul 11, 2008 at 2:13 AM, Shehan Simen <ss...@itree.com.au> wrote:


Hi Eran,
Yes, I was able to capture it successfully inside the XXXXMessageReceiverInOut.class generated by wsdl2java.
Thankx for your help.
 
Regards,
simen
 


From: Shehan Simen [mailto:ssimen@itree.com.au] Sent: Friday, 11 July 2008 3:29 PM

To: axis-user@ws.apache.org
Subject: RE: How to print axis2 request and response


 
Thank you Eran,
Yes, I am the service author and I am thinking to put this inside the service implementation.
I like to do this in more high level, rather than digging into complex code inside axis.
I use the code generated by wsdl2java.
I don't see anything like MessageContext. It may be more deeper inside axis2.
Is there any simpler way to do this?
Please help me.
 
Regards,
Simen
 

From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com] Sent: Friday, 11 July 2008 3:15 PMTo: axis-user@ws.apache.orgSubject: Re: How to print axis2 request and response
 
MessageContext messageContext = MessageContext.getCurrentMessageContext();String request = messageContext.getEnvelope().toString();The above code will give you the SOAP message in the current message context. If you use the above code in the in flow, you will get the request message and you will get the response message if you put the above code in outflow. Are you the service author and are you thinking of putting this code, inside your service implementation class?There is another way of doing this operation context, but I need above info to give a better answer. 

On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ss...@itree.com.au> wrote:


Hi Eran,
As I am developing the web service, I have the access to all the objects from the server side.
How can I save the incoming soap requests and outgoing soap response messages to the database?
I want to save everything which is going through the wire. (or at least part of it as a xml message)
Please send me a helpful reply.
 
Thank you.
Simen
 

From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com] Sent: Friday, 11 July 2008 2:19 PMTo: axis-user@ws.apache.orgSubject: Re: How to print axis2 request and response


 
Will you have access to request and response objects? If you are using Axis2 war app, unless you like to get ur hands wet, I don't see a way to do that. 

On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au> wrote:


Hi,
I want to save the web service request/response to the database as a string or blob.
How can I implement the request.toString() and response.toString() methods?
I am using axis2 and wsdl2java code generation.
I don't want to play with the generated code.
Is there an easier way to do this, without mucking around with soap envelop and other more detailed technical stuff?
 
thx
-- With Mettha,Eran Chinthaka--------------------------------------------------------------------Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada 
-- With Mettha,Eran Chinthaka--------------------------------------------------------------------Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada 
-- Amila Suriarachchi,WSO2 Inc. 
_________________________________________________________________
Use video conversation to talk face-to-face with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_072008

RE: How to print axis2 request and response

Posted by Shehan Simen <ss...@itree.com.au>.
Hi Amila,
Is there any tutorial for writing axis2 handler?
I have no idea about the module.xml

From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
Sent: Monday, 14 July 2008 4:17 PM
To: axis-user@ws.apache.org
Subject: Re: How to print axis2 request and response

you can write an Axis2 Handler to log the soap message. and then put this handler to inflow and outflow using a module.xml. This means you have to write Axis2 module and engage it your service.

thanks,
Amila.
On Fri, Jul 11, 2008 at 2:13 AM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi Eran,

Yes, I was able to capture it successfully inside the XXXXMessageReceiverInOut.class generated by wsdl2java.

Thankx for your help.



Regards,

simen



From: Shehan Simen [mailto:ssimen@itree.com.au<ma...@itree.com.au>]
Sent: Friday, 11 July 2008 3:29 PM

To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: RE: How to print axis2 request and response



Thank you Eran,

Yes, I am the service author and I am thinking to put this inside the service implementation.

I like to do this in more high level, rather than digging into complex code inside axis.

I use the code generated by wsdl2java.

I don't see anything like MessageContext. It may be more deeper inside axis2.

Is there any simpler way to do this?

Please help me.



Regards,

Simen



From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com<ma...@gmail.com>]
Sent: Friday, 11 July 2008 3:15 PM
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: How to print axis2 request and response



MessageContext messageContext = MessageContext.getCurrentMessageContext();
String request = messageContext.getEnvelope().toString();

The above code will give you the SOAP message in the current message context. If you use the above code in the in flow, you will get the request message and you will get the response message if you put the above code in outflow.

Are you the service author and are you thinking of putting this code, inside your service implementation class?

There is another way of doing this operation context, but I need above info to give a better answer.

On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi Eran,

As I am developing the web service, I have the access to all the objects from the server side.

How can I save the incoming soap requests and outgoing soap response messages to the database?

I want to save everything which is going through the wire. (or at least part of it as a xml message)

Please send me a helpful reply.



Thank you.

Simen



From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com<ma...@gmail.com>]
Sent: Friday, 11 July 2008 2:19 PM
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: How to print axis2 request and response



Will you have access to request and response objects? If you are using Axis2 war app, unless you like to get ur hands wet, I don't see a way to do that.

On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi,

I want to save the web service request/response to the database as a string or blob.

How can I implement the request.toString() and response.toString() methods?

I am using axis2 and wsdl2java code generation.

I don't want to play with the generated code.

Is there an easier way to do this, without mucking around with soap envelop and other more detailed technical stuff?



thx



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada



--
Amila Suriarachchi,
WSO2 Inc.

Re: How to print axis2 request and response

Posted by Amila Suriarachchi <am...@gmail.com>.
you can write an Axis2 Handler to log the soap message. and then put this
handler to inflow and outflow using a module.xml. This means you have to
write Axis2 module and engage it your service.

thanks,
Amila.

On Fri, Jul 11, 2008 at 2:13 AM, Shehan Simen <ss...@itree.com.au> wrote:

>  Hi Eran,
>
> Yes, I was able to capture it successfully inside the
> XXXXMessageReceiverInOut.class generated by wsdl2java.
>
> Thankx for your help.
>
>
>
> Regards,
>
> simen
>
>
>
> *From:* Shehan Simen [mailto:ssimen@itree.com.au]
> *Sent:* Friday, 11 July 2008 3:29 PM
> *To:* axis-user@ws.apache.org
> *Subject:* RE: How to print axis2 request and response
>
>
>
> Thank you Eran,
>
> Yes, I am the service author and I am thinking to put this inside the
> service implementation.
>
> I like to do this in more high level, rather than digging into complex code
> inside axis.
>
> I use the code generated by wsdl2java.
>
> I don't see anything like MessageContext. It may be more deeper inside
> axis2.
>
> Is there any simpler way to do this?
>
> Please help me.
>
>
>
> Regards,
>
> Simen
>
>
>
> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com]
> *Sent:* Friday, 11 July 2008 3:15 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: How to print axis2 request and response
>
>
>
> MessageContext messageContext = MessageContext.getCurrentMessageContext();
> String request = messageContext.getEnvelope().toString();
>
> The above code will give you the SOAP message in the current message
> context. If you use the above code in the in flow, you will get the request
> message and you will get the response message if you put the above code in
> outflow.
>
> Are you the service author and are you thinking of putting this code,
> inside your service implementation class?
>
> There is another way of doing this operation context, but I need above info
> to give a better answer.
>
> On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ss...@itree.com.au> wrote:
>
> Hi Eran,
>
> As I am developing the web service, I have the access to all the objects
> from the server side.
>
> How can I save the incoming soap requests and outgoing soap response
> messages to the database?
>
> I want to save everything which is going through the wire. (or at least
> part of it as a xml message)
>
> Please send me a helpful reply.
>
>
>
> Thank you.
>
> Simen
>
>
>
> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com]
> *Sent:* Friday, 11 July 2008 2:19 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: How to print axis2 request and response
>
>
>
> Will you have access to request and response objects? If you are using
> Axis2 war app, unless you like to get ur hands wet, I don't see a way to do
> that.
>
> On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au> wrote:
>
> Hi,
>
> I want to save the web service request/response to the database as a string
> or blob.
>
> How can I implement the request.toString() and response.toString() methods?
>
> I am using axis2 and wsdl2java code generation.
>
> I don't want to play with the generated code.
>
> Is there an easier way to do this, without mucking around with soap envelop
> and other more detailed technical stuff?
>
>
>
> thx
>
>
>
>
> --
> With Mettha,
> Eran Chinthaka
>
> --------------------------------------------------------------------
> Health is the greatest gift; contentment is the greatest wealth; trusting
> is the best relationship; nirvana is the highest joy. - Dhammapada
>
>
>
>
> --
> With Mettha,
> Eran Chinthaka
>
> --------------------------------------------------------------------
> Health is the greatest gift; contentment is the greatest wealth; trusting
> is the best relationship; nirvana is the highest joy. - Dhammapada
>



-- 
Amila Suriarachchi,
WSO2 Inc.

RE: How to print axis2 request and response

Posted by Shehan Simen <ss...@itree.com.au>.
Hi Eran,
Yes, I was able to capture it successfully inside the XXXXMessageReceiverInOut.class generated by wsdl2java.
Thankx for your help.

Regards,
simen

From: Shehan Simen [mailto:ssimen@itree.com.au]
Sent: Friday, 11 July 2008 3:29 PM
To: axis-user@ws.apache.org
Subject: RE: How to print axis2 request and response

Thank you Eran,
Yes, I am the service author and I am thinking to put this inside the service implementation.
I like to do this in more high level, rather than digging into complex code inside axis.
I use the code generated by wsdl2java.
I don't see anything like MessageContext. It may be more deeper inside axis2.
Is there any simpler way to do this?
Please help me.

Regards,
Simen

From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com]
Sent: Friday, 11 July 2008 3:15 PM
To: axis-user@ws.apache.org
Subject: Re: How to print axis2 request and response

MessageContext messageContext = MessageContext.getCurrentMessageContext();
String request = messageContext.getEnvelope().toString();

The above code will give you the SOAP message in the current message context. If you use the above code in the in flow, you will get the request message and you will get the response message if you put the above code in outflow.

Are you the service author and are you thinking of putting this code, inside your service implementation class?

There is another way of doing this operation context, but I need above info to give a better answer.
On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi Eran,

As I am developing the web service, I have the access to all the objects from the server side.

How can I save the incoming soap requests and outgoing soap response messages to the database?

I want to save everything which is going through the wire. (or at least part of it as a xml message)

Please send me a helpful reply.



Thank you.

Simen



From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com<ma...@gmail.com>]
Sent: Friday, 11 July 2008 2:19 PM
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: How to print axis2 request and response



Will you have access to request and response objects? If you are using Axis2 war app, unless you like to get ur hands wet, I don't see a way to do that.

On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi,

I want to save the web service request/response to the database as a string or blob.

How can I implement the request.toString() and response.toString() methods?

I am using axis2 and wsdl2java code generation.

I don't want to play with the generated code.

Is there an easier way to do this, without mucking around with soap envelop and other more detailed technical stuff?



thx



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada

RE: How to print axis2 request and response

Posted by Shehan Simen <ss...@itree.com.au>.
Thank you Eran,
Yes, I am the service author and I am thinking to put this inside the service implementation.
I like to do this in more high level, rather than digging into complex code inside axis.
I use the code generated by wsdl2java.
I don't see anything like MessageContext. It may be more deeper inside axis2.
Is there any simpler way to do this?
Please help me.

Regards,
Simen

From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com]
Sent: Friday, 11 July 2008 3:15 PM
To: axis-user@ws.apache.org
Subject: Re: How to print axis2 request and response

MessageContext messageContext = MessageContext.getCurrentMessageContext();
String request = messageContext.getEnvelope().toString();

The above code will give you the SOAP message in the current message context. If you use the above code in the in flow, you will get the request message and you will get the response message if you put the above code in outflow.

Are you the service author and are you thinking of putting this code, inside your service implementation class?

There is another way of doing this operation context, but I need above info to give a better answer.
On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi Eran,

As I am developing the web service, I have the access to all the objects from the server side.

How can I save the incoming soap requests and outgoing soap response messages to the database?

I want to save everything which is going through the wire. (or at least part of it as a xml message)

Please send me a helpful reply.



Thank you.

Simen



From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com<ma...@gmail.com>]
Sent: Friday, 11 July 2008 2:19 PM
To: axis-user@ws.apache.org<ma...@ws.apache.org>
Subject: Re: How to print axis2 request and response



Will you have access to request and response objects? If you are using Axis2 war app, unless you like to get ur hands wet, I don't see a way to do that.

On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi,

I want to save the web service request/response to the database as a string or blob.

How can I implement the request.toString() and response.toString() methods?

I am using axis2 and wsdl2java code generation.

I don't want to play with the generated code.

Is there an easier way to do this, without mucking around with soap envelop and other more detailed technical stuff?



thx



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada

Re: How to print axis2 request and response

Posted by Eran Chinthaka <er...@gmail.com>.
MessageContext messageContext = MessageContext.getCurrentMessageContext();
String request = messageContext.getEnvelope().toString();

The above code will give you the SOAP message in the current message
context. If you use the above code in the in flow, you will get the request
message and you will get the response message if you put the above code in
outflow.

Are you the service author and are you thinking of putting this code, inside
your service implementation class?

There is another way of doing this operation context, but I need above info
to give a better answer.

On Thu, Jul 10, 2008 at 9:51 PM, Shehan Simen <ss...@itree.com.au> wrote:

>  Hi Eran,
>
> As I am developing the web service, I have the access to all the objects
> from the server side.
>
> How can I save the incoming soap requests and outgoing soap response
> messages to the database?
>
> I want to save everything which is going through the wire. (or at least
> part of it as a xml message)
>
> Please send me a helpful reply.
>
>
>
> Thank you.
>
> Simen
>
>
>
> *From:* Eran Chinthaka [mailto:eran.chinthaka@gmail.com]
> *Sent:* Friday, 11 July 2008 2:19 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: How to print axis2 request and response
>
>
>
> Will you have access to request and response objects? If you are using
> Axis2 war app, unless you like to get ur hands wet, I don't see a way to do
> that.
>
> On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au> wrote:
>
> Hi,
>
> I want to save the web service request/response to the database as a string
> or blob.
>
> How can I implement the request.toString() and response.toString() methods?
>
> I am using axis2 and wsdl2java code generation.
>
> I don't want to play with the generated code.
>
> Is there an easier way to do this, without mucking around with soap envelop
> and other more detailed technical stuff?
>
>
>
> thx
>
>
>
>
> --
> With Mettha,
> Eran Chinthaka
>
> --------------------------------------------------------------------
> Health is the greatest gift; contentment is the greatest wealth; trusting
> is the best relationship; nirvana is the highest joy. - Dhammapada
>



-- 
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada

RE: How to print axis2 request and response

Posted by Shehan Simen <ss...@itree.com.au>.
Hi Eran,
As I am developing the web service, I have the access to all the objects from the server side.
How can I save the incoming soap requests and outgoing soap response messages to the database?
I want to save everything which is going through the wire. (or at least part of it as a xml message)
Please send me a helpful reply.

Thank you.
Simen

From: Eran Chinthaka [mailto:eran.chinthaka@gmail.com]
Sent: Friday, 11 July 2008 2:19 PM
To: axis-user@ws.apache.org
Subject: Re: How to print axis2 request and response

Will you have access to request and response objects? If you are using Axis2 war app, unless you like to get ur hands wet, I don't see a way to do that.
On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au>> wrote:

Hi,

I want to save the web service request/response to the database as a string or blob.

How can I implement the request.toString() and response.toString() methods?

I am using axis2 and wsdl2java code generation.

I don't want to play with the generated code.

Is there an easier way to do this, without mucking around with soap envelop and other more detailed technical stuff?



thx



--
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is the best relationship; nirvana is the highest joy. - Dhammapada

Re: How to print axis2 request and response

Posted by Eran Chinthaka <er...@gmail.com>.
Will you have access to request and response objects? If you are using Axis2
war app, unless you like to get ur hands wet, I don't see a way to do that.

On Thu, Jul 10, 2008 at 6:38 PM, Shehan Simen <ss...@itree.com.au> wrote:

>  Hi,
>
> I want to save the web service request/response to the database as a string
> or blob.
>
> How can I implement the request.toString() and response.toString() methods?
>
> I am using axis2 and wsdl2java code generation.
>
> I don't want to play with the generated code.
>
> Is there an easier way to do this, without mucking around with soap envelop
> and other more detailed technical stuff?
>
>
>
> thx
>



-- 
With Mettha,
Eran Chinthaka

--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada