Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

get xml from request body  RSS feed

 
John Juliciana
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Naren Mane
Greenhorn
Posts: 16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!