• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Getting the Raw Request and Response XML from axis.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to read up on how to use handlers, my post here gives some details
https://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
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this ...
http://wiki.apache.org/ws/FrontPage/Axis/AxisClientConfiguration/ViewSOAPMessages
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vi Manch wrote:try this ...
http://wiki.apache.org/ws/FrontPage/Axis/AxisClientConfiguration/ViewSOAPMessages



Thank you, Thank you, Thank you.
I looked at their Wiki and I must have over-looked this.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.."

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Seriously? That's what you're going with? I prefer this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic