• Post Reply Bookmark Topic Watch Topic
  • New Topic

SOAP with JAXb  RSS feed

 
srikanth darbha
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a query Jaxb is used for marshaling and un-marshaling of java objects ,i.e we will get an xml from an java pojo class using jaxb ,
my query is how can we convert this plain xml into a SOAP req. ,i.e to add soap headers,etc in that xml file which is converted using JAXB.
Kindly please help me out.


Thanks in Advance,
D.Srikanth
 
Vijitha Kumara
Bartender
Posts: 3993
31
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There could be many ways (depending on the usage) but simply you can use the APIs provided in javax.xml.soap to create SOAP message.
 
srikanth darbha
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:There could be many ways (depending on the usage) but simply you can use the APIs provided in javax.xml.soap to create SOAP message.


Thanks Vijitha ,i have googled it and found that we can use that SOAP API,but have a doubt how to convert a normal xml file which is in String to a interface Element type.

Regards,
D.Srikanth
 
Sujeeth Pakala
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need SOAP message ?

Are you trying to program a web service client to send SOAP message to a service provider?

Here you are doing this which is not good design.

Java Object (JAXB) -> String (XML) -> Java Object -> Java Object (SOAP) -> String (SOAP).

my query is how can we convert this plain xml into a SOAP req


To build SOAP message, you do not need to unmarshall object to string.

There are web service APIs like JAX-WS which has support for JAXB and SOAP API. Through this you can develop a WS client program which builds SOAP message for you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!