This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

SOAP with JAXb

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic