Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting the Raw Request and Response XML from axis.

 
Sri Ram
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me how to get the raw request and response using axis??? any reference links???


Thanks and Regards,
Sriram
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't know if this is the best way to do it - but think it does what you're asking for.
Add a handler (see my other post today about this) and make it print out the SOAP messages as they come in and go out

does this help ?

Example code which I've just tried and seems to work

 
Sri Ram
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you tell me how to use this class??
 
michael warren
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to read up on how to use handlers, my post here gives some details
http://www.coderanch.com/t/148792/java-Web-Services-SCDJWS/certification/configuring-handlers-programmatically

perhaps have a look here for more stuff about handlers
http://java.boot.by/wsd-guide/ch04s07.html
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more easier way is to use netmon or tcpmon tool to intercept the messages

1. TCP/IP Monitor in eclipse plugin too can help
Let us assume Webservice is runninig in Port A
Now in the client code, change the endpoint port address to B ( Local Port at which the tcp ip tool listens and redirects to Port A
Local Port is B
Server Port is A
Once you give hit to the service using client code, you can able to see the messages in the tool
 
Sri Ram
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually,I want to store the XML in a database.I dont want to use TCPMon.Can anyone tell me how to do this using Axis ??

Thanks and Regards,
Sriram
 
Karthik Rajendiran
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you going to store xml in DB.
1. You want parse and store the information
2. or You want to dumb the Xml file itself in DB
 
Vi Manch
Greenhorn
Posts: 3
 
Joe White
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thank you, Thank you, Thank you.
I looked at their Wiki and I must have over-looked this.
 
Bhupendra Shivade
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have class which implements org.apache.axis2.databinding.ADBBean this interface then its pretty simple to get Soap Request and Soap response(i.e raw xml which is posted from client)
call this method on the object
getOMElement(null, OMAbstractFactory.getOMFactory()).toStringWithConsume())
This will give you Soap request or response based on object which you call method on.


Cheers
Bhupendra
 
Emrah Kivanc
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Here the problem is, Request and Response methods are different,
Is there a way to handle "Request XML Messages or HttpServletRequest" in response scope..
I mean Is there a way to get "request Soap Message" while inbound direction ( meaning while getting response... )

My AxisHandler implements "SOAPHandler"..

(Otherwise I need to save "RequestXML_Message" in a Class variable up to getting response or fault message,
After getting ResponseXML or Fault then I will able to log all the Messages together..
But keeping the requestMessage in a class variable is not a safe state i think..)

I have tried the following code but it always returns "nullPointerException.."

 
Daniel Val
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Emrah Kivanc wrote:Hi,
Here the problem is, Request and Response methods are different,
...


It worked for me as follows:

http://proghowto.com/axis-client-request-and-response-logging

Just ensure that when you log the stuff, it is really on one line.

Regards,
Daniel
 
deepika deepi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi dear experts,

i have some doubt in java coding.. for search engine process.. can you kindly tell me how to do??? for Inverted Index??? kindly help me sir....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic