Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Joining SAAJ and JAXB  RSS feed

 
Emir Bugra Koksalan
Greenhorn
Posts: 9
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm creating a SOAP web service withoug axis. I'm using SAAJ, JAXB and Servlet. I can marshall and unmarshall a class with JAXB correctly. But how can I use together SAAJ and JAXB for SOAP communication. I want put the JAXB converted xml text to SOAP BODY tag with SAAJ. How can I do this? I read SAAJ documents that's on the Oracle site but it isn't understandable. They tell so complex.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to use SAAJ, specifically? If you use JAX-WS, all the JAXB stuff is done for you automatically if you add the appropriate annotations.
 
Emir Bugra Koksalan
Greenhorn
Posts: 9
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Why do you want to use SAAJ, specifically? If you use JAX-WS, all the JAXB stuff is done for you automatically if you add the appropriate annotations.


Because examples are using SAAJ. No implementation together SAAJ and JAXB. But I will make investigate about JAX-WS..

And there is a question more. I have schema and wsdl files. How will I use these? I used wsimport and xjc commands, I created java files but it seems like there are some ununderstanded issues for me. For example what is difference between wsimport and xjc?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because examples are using SAAJ.

That doesn't strike as a particularly good reason - it's easy to find plenty of example using JAX-WS.

No implementation together SAAJ and JAXB.

Right - because it's very unusual to use them together. If you want to build a SOAP WS using JAXB, then JAX-WS is the API to use.

For example what is difference between wsimport and xjc?

I'm sure that the documentation of whichever SOAP engine you're using has a chapter on how to use its tools.
 
Moove Elanchezhiyan
Greenhorn
Posts: 1
Hibernate Java Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.mkyong.com/tutorials/jax-ws-tutorials/

The above link holds the step by step example in creating a WS using JAX. Hope it will be useful for you.
 
Emir Bugra Koksalan
Greenhorn
Posts: 9
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moove Elanchezhiyan wrote:http://www.mkyong.com/tutorials/jax-ws-tutorials/

The above link holds the step by step example in creating a WS using JAX. Hope it will be useful for you.


yes I'm looking that. thanks a lot...
 
surlac surlacovich
Ranch Hand
Posts: 296
Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create XSD schema for your JAXB beans, generate code from that, instantiate a bean, fill the fields, then marshal the object to XML-String with javax.xml.bind.Marshaller, and put the string to SOAPEnvelope with SAAJ:



This is an example of SAAJ + JAXB.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!