You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shadab <sh...@aricent.com> on 2007/07/19 09:42:47 UTC

Unmarshalling XML documents to Java Objects

Hi,

I have to obtain populated Java objects against a XML document (holding
data) and a set of xsds.

I have to send these objects as parameters to the methods of generated
skeleton from Axis1.4.

Please tell me if there is a way similar to JAXB in Axis1.4, for
unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
understand and send it to the skeletons method.

B.R.
Shadab
  


-- 
View this message in context: http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Unmarshalling XML documents to Java Objects

Posted by Upul Godage <up...@gmail.com>.
"Axis2" supports data bindings ADB (Axis Data Bindin), XMLBeans, JibX.  Also
Axis2 comes with an object model called AXIOM. There are samples at
http://ws.apache.org/axis2/1_2/quickstartguide.html


On 7/19/07, Shadab <sh...@aricent.com> wrote:
>
>
> Hi,
>
> I have to obtain populated Java objects against a XML document (holding
> data) and a set of xsds.
>
> I have to send these objects as parameters to the methods of generated
> skeleton from Axis1.4.
>
> Please tell me if there is a way similar to JAXB in Axis1.4, for
> unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
> understand and send it to the skeletons method.
>
> B.R.
> Shadab
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Unmarshalling XML documents to Java Objects

Posted by Shadab <sh...@aricent.com>.
Anne you are absolutely right in understanding my problem...



Anne Thomas Manes wrote:
> 
> I believe Enric is referring to Axis2. Please note that Shadab's
> question was in respect to Axis 1.4.
> 
> When using Axis 1.4, you can bypass the built-in Axis serialization
> framework by using the Message provider, and then use your own
> DOM-based XML databinding framework. But I'm not convinced that this
> approach will address Shadab's question.
> 
> My reading of Shadab's question (please correct me if I'm wrong) is
> that his application receives an XML document (not SOAP -- source not
> specified). He then wants to map the XML content to Java objects, then
> invoke (or perhaps reply to a) SOAP request and map the Java object
> content to the SOAP message. The Axis serialization framework will
> handle the second part (serialization and deserialization of SOAP
> messages to and from Java objects). But Axis does not provide a
> general-purpose XML binding framework than can be used with arbitrary
> XML documents.
> 
> Anne
> 
> 
> On 7/19/07, Enric Staromiejski Torregrosa <en...@gmail.com>
> wrote:
>> Hi Shadab,
>>
>> i've been able to build a client and server using jaxb-2.1.2 and
>> document/literal web service style. If your Schemes are not complex this
>> is
>> as easy as using the -d jaxbri option from the wsdl2java tool. If your
>> schemes are complex ( i.e. highly architectured) this option is not
>> working
>> fine but can also be worked around.
>>
>> Regards,
>> Enric
>>
>> 2007/7/19, Shadab <shadab.khan@aricent.com >:
>> >
>> > Hi,
>> >
>> > I have to obtain populated Java objects against a XML document (holding
>> > data) and a set of xsds.
>> >
>> > I have to send these objects as parameters to the methods of generated
>> > skeleton from Axis1.4.
>> >
>> > Please tell me if there is a way similar to JAXB in Axis1.4, for
>> > unmarshalling XML to serialized Java Objects which the Axis1.4 engine
>> can
>> > understand and send it to the skeletons method.
>> >
>> > B.R.
>> > Shadab
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
>> > Sent from the Axis - User mailing list archive at Nabble.com.
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> axis-user-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>> >
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11702978
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Unmarshalling XML documents to Java Objects

Posted by Enric Staromiejski Torregrosa <en...@gmail.com>.
Sorry, you're 100% right. i misread the mails.



2007/7/19, Anne Thomas Manes <at...@gmail.com>:
>
> I believe Enric is referring to Axis2. Please note that Shadab's
> question was in respect to Axis 1.4.
>
> When using Axis 1.4, you can bypass the built-in Axis serialization
> framework by using the Message provider, and then use your own
> DOM-based XML databinding framework. But I'm not convinced that this
> approach will address Shadab's question.
>
> My reading of Shadab's question (please correct me if I'm wrong) is
> that his application receives an XML document (not SOAP -- source not
> specified). He then wants to map the XML content to Java objects, then
> invoke (or perhaps reply to a) SOAP request and map the Java object
> content to the SOAP message. The Axis serialization framework will
> handle the second part (serialization and deserialization of SOAP
> messages to and from Java objects). But Axis does not provide a
> general-purpose XML binding framework than can be used with arbitrary
> XML documents.
>
> Anne
>
>
> On 7/19/07, Enric Staromiejski Torregrosa <en...@gmail.com>
> wrote:
> > Hi Shadab,
> >
> > i've been able to build a client and server using jaxb-2.1.2 and
> > document/literal web service style. If your Schemes are not complex this
> is
> > as easy as using the -d jaxbri option from the wsdl2java tool. If your
> > schemes are complex ( i.e. highly architectured) this option is not
> working
> > fine but can also be worked around.
> >
> > Regards,
> > Enric
> >
> > 2007/7/19, Shadab <shadab.khan@aricent.com >:
> > >
> > > Hi,
> > >
> > > I have to obtain populated Java objects against a XML document
> (holding
> > > data) and a set of xsds.
> > >
> > > I have to send these objects as parameters to the methods of generated
> > > skeleton from Axis1.4.
> > >
> > > Please tell me if there is a way similar to JAXB in Axis1.4, for
> > > unmarshalling XML to serialized Java Objects which the Axis1.4 engine
> can
> > > understand and send it to the skeletons method.
> > >
> > > B.R.
> > > Shadab
> > >
> > >
> > >
> > > --
> > > View this message in context:
> >
> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
> > > Sent from the Axis - User mailing list archive at Nabble.com.
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Unmarshalling XML documents to Java Objects

Posted by Anne Thomas Manes <at...@gmail.com>.
I believe Enric is referring to Axis2. Please note that Shadab's
question was in respect to Axis 1.4.

When using Axis 1.4, you can bypass the built-in Axis serialization
framework by using the Message provider, and then use your own
DOM-based XML databinding framework. But I'm not convinced that this
approach will address Shadab's question.

My reading of Shadab's question (please correct me if I'm wrong) is
that his application receives an XML document (not SOAP -- source not
specified). He then wants to map the XML content to Java objects, then
invoke (or perhaps reply to a) SOAP request and map the Java object
content to the SOAP message. The Axis serialization framework will
handle the second part (serialization and deserialization of SOAP
messages to and from Java objects). But Axis does not provide a
general-purpose XML binding framework than can be used with arbitrary
XML documents.

Anne


On 7/19/07, Enric Staromiejski Torregrosa <en...@gmail.com> wrote:
> Hi Shadab,
>
> i've been able to build a client and server using jaxb-2.1.2 and
> document/literal web service style. If your Schemes are not complex this is
> as easy as using the -d jaxbri option from the wsdl2java tool. If your
> schemes are complex ( i.e. highly architectured) this option is not working
> fine but can also be worked around.
>
> Regards,
> Enric
>
> 2007/7/19, Shadab <shadab.khan@aricent.com >:
> >
> > Hi,
> >
> > I have to obtain populated Java objects against a XML document (holding
> > data) and a set of xsds.
> >
> > I have to send these objects as parameters to the methods of generated
> > skeleton from Axis1.4.
> >
> > Please tell me if there is a way similar to JAXB in Axis1.4, for
> > unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
> > understand and send it to the skeletons method.
> >
> > B.R.
> > Shadab
> >
> >
> >
> > --
> > View this message in context:
> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
> > Sent from the Axis - User mailing list archive at Nabble.com.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Unmarshalling XML documents to Java Objects

Posted by Enric Staromiejski Torregrosa <en...@gmail.com>.
Hi Shadab,

i've been able to build a client and server using jaxb-2.1.2 and
document/literal web service style. If your Schemes are not complex this is
as easy as using the -d jaxbri option from the wsdl2java tool. If your
schemes are complex (i.e. highly architectured) this option is not working
fine but can also be worked around.

Regards,
Enric

2007/7/19, Shadab <sh...@aricent.com>:
>
>
> Hi,
>
> I have to obtain populated Java objects against a XML document (holding
> data) and a set of xsds.
>
> I have to send these objects as parameters to the methods of generated
> skeleton from Axis1.4.
>
> Please tell me if there is a way similar to JAXB in Axis1.4, for
> unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
> understand and send it to the skeletons method.
>
> B.R.
> Shadab
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Unmarshalling XML documents to Java Objects

Posted by Anne Thomas Manes <at...@gmail.com>.
I recommend that you use an XML databinding framework, such as JAXB,
Castor XML, or XMLBeans. Alternatively, if you don't need to
manipulate the incoming XML, you could use the Axis message style or
the SAAJ API and simply map the data directly from the incoming XML
(using JAXP) to your SOAP message structure.

Anne

On 7/20/07, Shadab <sh...@aricent.com> wrote:
>
> Hi Anne,
>
> I have to develop a client that gets the data in the form of XML.
>
> This XML is actually generated by some other party and they seemed to have
> done it like this:
>   -generated Java classes from xsd using JAXB's xjc
>   -populated the objects of these Java classes with values
>   -Then generated XML from these Java Objects using Marshal of JAXB.
>
> Now I have to parse this XML into Java Objects so that they can be sent
> across to the skeleton's method which would be expecting objects generated
> by Axis.
>
> If not understood please ask me again.
>
> And please tell how to convert this XML into Java Objects which can be taken
> up by Axis engine and skeleton's method which would be expecting Axis
> generated Java type.
>
> Best Regards,
> Shadab
>
>
>
>
> Anne Thomas Manes wrote:
> >
> > Axis provides a built in serialization framework. If you use the RPC
> > provider, Axis will automatically map Java objects to XML and vice
> > versa. But this only applies to serialization and deserialization of
> > the SOAP messages. It can't be used for just any XML document.
> >
> > Is that what you're looking for?
> >
> > Anne
> >
> > On 7/19/07, Shadab <sh...@aricent.com> wrote:
> >>
> >> Hi,
> >>
> >> I have to obtain populated Java objects against a XML document (holding
> >> data) and a set of xsds.
> >>
> >> I have to send these objects as parameters to the methods of generated
> >> skeleton from Axis1.4.
> >>
> >> Please tell me if there is a way similar to JAXB in Axis1.4, for
> >> unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
> >> understand and send it to the skeletons method.
> >>
> >> B.R.
> >> Shadab
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
> >> Sent from the Axis - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11706136
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Unmarshalling XML documents to Java Objects

Posted by Shadab <sh...@aricent.com>.
Hi Anne,

I have to develop a client that gets the data in the form of XML.

This XML is actually generated by some other party and they seemed to have
done it like this:
  -generated Java classes from xsd using JAXB's xjc
  -populated the objects of these Java classes with values
  -Then generated XML from these Java Objects using Marshal of JAXB.

Now I have to parse this XML into Java Objects so that they can be sent
across to the skeleton's method which would be expecting objects generated
by Axis.

If not understood please ask me again.

And please tell how to convert this XML into Java Objects which can be taken
up by Axis engine and skeleton's method which would be expecting Axis
generated Java type.

Best Regards,
Shadab




Anne Thomas Manes wrote:
> 
> Axis provides a built in serialization framework. If you use the RPC
> provider, Axis will automatically map Java objects to XML and vice
> versa. But this only applies to serialization and deserialization of
> the SOAP messages. It can't be used for just any XML document.
> 
> Is that what you're looking for?
> 
> Anne
> 
> On 7/19/07, Shadab <sh...@aricent.com> wrote:
>>
>> Hi,
>>
>> I have to obtain populated Java objects against a XML document (holding
>> data) and a set of xsds.
>>
>> I have to send these objects as parameters to the methods of generated
>> skeleton from Axis1.4.
>>
>> Please tell me if there is a way similar to JAXB in Axis1.4, for
>> unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
>> understand and send it to the skeletons method.
>>
>> B.R.
>> Shadab
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11706136
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Unmarshalling XML documents to Java Objects

Posted by Anne Thomas Manes <at...@gmail.com>.
Axis provides a built in serialization framework. If you use the RPC
provider, Axis will automatically map Java objects to XML and vice
versa. But this only applies to serialization and deserialization of
the SOAP messages. It can't be used for just any XML document.

Is that what you're looking for?

Anne

On 7/19/07, Shadab <sh...@aricent.com> wrote:
>
> Hi,
>
> I have to obtain populated Java objects against a XML document (holding
> data) and a set of xsds.
>
> I have to send these objects as parameters to the methods of generated
> skeleton from Axis1.4.
>
> Please tell me if there is a way similar to JAXB in Axis1.4, for
> unmarshalling XML to serialized Java Objects which the Axis1.4 engine can
> understand and send it to the skeletons method.
>
> B.R.
> Shadab
>
>
>
> --
> View this message in context: http://www.nabble.com/Unmarshalling-XML-documents-to-Java-Objects-tf4108674.html#a11683862
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org