Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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: 4109
72
Hibernate Fedora Chrome
  • 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.
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic