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

web service that takes a JAXB class

 
Robyn Haas
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgive this question, but I'm very new to web services!

I've got an application that takes a xml document in a request parameter attribute of a HTTP post. This xml document validates to custom xsd I created and I currently use JAXB to unmarshall the xml so I can pull the data out and insert it into my database.

What I'd like to do instead is create a web service that receives the xml document in a soap message. Do I create a method that takes my JAXB generated class in the method signature and create the web service off of that method? How exactly do I create a web service that takes in custom xml? I also will want some authenticating data along with the xml like a username and password. Can someone point me in the right direction?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For authentication you can use either HTTP authentication or WS-Security (in the shape of WSS4J), links to both of which you'll find in the FAQ in my signature.

As to sending an XML document, you may want to look into the different WSDL styles, some of which allow you to send an XML document over SOAP as it is; there's a link to an introductory article in the FAQ as well.
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you look at the Message Style Web Service support from AXIS ?
 
Robyn Haas
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that helps! I also found this article last night that might get me going in the right direction: http://www-128.ibm.com/developerworks/webservices/library/ws-castor/ The article talks about integrating Castor and Axis and I'm hoping that I can use JAXB instead of the Castor. I'll also look into WSS4J.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic