aspose file tools
The moose likes Web Services and the fly likes get xml from request body Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "get xml from request body" Watch "get xml from request body" New topic
Author

get xml from request body

John Juliciana
Greenhorn

Joined: Apr 17, 2011
Posts: 2
i have a requirement to read a xml from a 3rd party which is sent via xml over http in the request body and post it to a different WEB service. I have to write a web service to capture that XML and post it. How do i read the XML which comes in the request body and post it using Axis? Im new to web services and need help on this. i have a setup axis 2 and apache successfully.



Any help is highly appreciated

Thanks in advance

John
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35220
    
    7
Axis is all about SOAP services. If the incoming request is just XML (but not SOAP) then Axis is not the tool of choice. A regular servlet would be able to handle that, though.


Android appsImageJ pluginsJava web charts
Naren Mane
Greenhorn

Joined: Mar 02, 2011
Posts: 16

John Juliciana wrote:i have a requirement to read a xml from a 3rd party which is sent via xml over http in the request body and post it to a different WEB service. I have to write a web service to capture that XML and post it. How do i read the XML which comes in the request body and post it using Axis? Im new to web services and need help on this. i have a setup axis 2 and apache successfully.



Any help is highly appreciated

Thanks in advance

John


Hi John,
Apache axis2 contains a tool called wsdl2java which generates stub(java classes) from wsdl. This stub will contain methods which are mapped to wsdl methods. In each method you'll find local variable called "env". On this "env" variable if you invoke getBody() call (i.e. env.getBody()) then it will return you SOAP request body(xml) sometimes it may be formatted to some notation(like '<' would be replaced with '<') , in such case you may need to apply your own logic to parse such notations.

Let me know if I'm not clear.

Thanks.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: get xml from request body
 
Similar Threads
Reading external XML file from an Axis Web Service
extract data from SOAP response
Axis "code portabiliy"
Web Services-SOAP over HTTP