• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

get xml from request body

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 16
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic