• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic