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 "Parham, Clinton" <cp...@biosignia.com> on 2008/05/06 22:59:29 UTC
Basic Axis/Axiom usage question
Hello.
I'm getting my feet wet with Axis & Axiom and something is just not clicking for me. Let's say I have a web service method that accepts and returns OMElements. The web service receives some data and builds a java.util.Collection of results objects that I need to send back as an XML payload in the response.
What is the correct (most efficient memory-wise) way to do this? Do I merely use factory.createOMElement / element.addAttribute to recreate the Collection objects in XML? Or, do I use something more elaborate like somehow wrapping the Collection with OMSourcedElementImpl and using OMDataSource?
Some guidance and pointers to a similar example would be appreciated.
Thank you,
Clinton
AW: Basic Axis/Axiom usage question
Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
And how would you do this?
In Visual Basic - I have an element with a name-field and a value-field both containing strings.
Element-objects are then collected in a collection which is called a work-space, and be accessed by a key
And this workspace-objects are collected in a workspace-collection, be accessed by a key
How would VB create from such a nested collection the SOAP-document hopefully then understood by AXIS2/AXIOM and the like
How would I send this to my AXIS2 Web-Service Server from VB client? .NET V3.0?
I have done it using PocketSoap and AXIS2/J+C AXIOM, AXUTIL, LIBXML, GZIP, etc the hard way down.
Now I am very glad to learn about a better easier approach and way to do that.
seriously , what do I have to look at?
How ?
Josef.Stadelmann
@axa-winterthur.ch
-----Ursprüngliche Nachricht-----
Von: robert lazarski [mailto:robertlazarski@gmail.com]
Gesendet: Mittwoch, 7. Mai 2008 03:48
An: axis-user@ws.apache.org
Betreff: Re: Basic Axis/Axiom usage question
Well watch out for the premature optimization trap. Measure, don't guess.
If you have a schema and pre-existing objects, I myself would be
looking into sending the objects over the wire as is. JIBX in
particular is pretty good at pre-existing objects and Collections.
Anyways, what Axiom / Stax does that's special is that you don't have
to build the tree. Its been a while since I worked with it, but if you
are determined to go with Axiom and are concerned about performance,
one thing to try might be creating a custom DataSource that implements
OMDataSource that streams the output. To go that way, I'd grep thru
the unit tests from the latest source for OMDataSource for examples
and pay attention to not building the tree in particular if possible.
HTH,
Robert
On Tue, May 6, 2008 at 10:14 PM, Parham, Clinton <cp...@biosignia.com> wrote:
> Robert: thanks for your input and I will keep your suggestions about data binding in mind. That aside, how would I do this the more manual way using OMElement? I have a specific schema to adhere to and already have a Java object model in place that I have to work with.
>
> To keep things simple, assume each object in the Collection becomes an XML element in the response payload. I want to be sure that I leverage the strengths of AXIOM/StAX and minimize memory usage.
>
>
>
> -----Original Message-----
> From: robert lazarski [mailto:robertlazarski@gmail.com]
> Sent: Tuesday, May 06, 2008 6:59 PM
> To: axis-user@ws.apache.org
> Subject: Re: Basic Axis/Axiom usage question
>
> Axiom is a good starting way to get to know Axis2, and in fact is
> involved in many of the low level parts parts of Axis2. However, if
> its Java Collections you want, you may consider using one of the
> higher level databinding API's like adb, xmlbeans, jibx, jaxb etc.
> Those type of API's can give you Java Collections, and when used in
> Axis2 code generation, hook into Axiom anyways though at a level you
> generally don't need to worry about unless there's a bug. When using
> those with Axis2 you need an xml schema and WSDL, hand generated or
> via reverse engineering existing code.
>
> One way of looking at things is the xml payload sent over the wire is
> in Arrays suitable for any language, and not just for Java
> Collections. With databinding, the xml payload is obstenably the same
> while the code level implemetation varies widely.
>
> HTH,
> Robert
>
> On Tue, May 6, 2008 at 5:59 PM, Parham, Clinton <cp...@biosignia.com> wrote:
> >
> >
> >
> >
> > Hello.
> >
> >
> >
> > I'm getting my feet wet with Axis & Axiom and something is just not clicking
> > for me. Let's say I have a web service method that accepts and returns
> > OMElements. The web service receives some data and builds a
> > java.util.Collection of results objects that I need to send back as an XML
> > payload in the response.
> >
> >
> >
> > What is the correct (most efficient memory-wise) way to do this? Do I merely
> > use factory.createOMElement / element.addAttribute to recreate the
> > Collection objects in XML? Or, do I use something more elaborate like
> > somehow wrapping the Collection with OMSourcedElementImpl and using
> > OMDataSource?
> >
> >
> >
> > Some guidance and pointers to a similar example would be appreciated.
> >
> >
> >
> > Thank you,
> >
> > Clinton
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
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: Basic Axis/Axiom usage question
Posted by robert lazarski <ro...@gmail.com>.
Well watch out for the premature optimization trap. Measure, don't guess.
If you have a schema and pre-existing objects, I myself would be
looking into sending the objects over the wire as is. JIBX in
particular is pretty good at pre-existing objects and Collections.
Anyways, what Axiom / Stax does that's special is that you don't have
to build the tree. Its been a while since I worked with it, but if you
are determined to go with Axiom and are concerned about performance,
one thing to try might be creating a custom DataSource that implements
OMDataSource that streams the output. To go that way, I'd grep thru
the unit tests from the latest source for OMDataSource for examples
and pay attention to not building the tree in particular if possible.
HTH,
Robert
On Tue, May 6, 2008 at 10:14 PM, Parham, Clinton <cp...@biosignia.com> wrote:
> Robert: thanks for your input and I will keep your suggestions about data binding in mind. That aside, how would I do this the more manual way using OMElement? I have a specific schema to adhere to and already have a Java object model in place that I have to work with.
>
> To keep things simple, assume each object in the Collection becomes an XML element in the response payload. I want to be sure that I leverage the strengths of AXIOM/StAX and minimize memory usage.
>
>
>
> -----Original Message-----
> From: robert lazarski [mailto:robertlazarski@gmail.com]
> Sent: Tuesday, May 06, 2008 6:59 PM
> To: axis-user@ws.apache.org
> Subject: Re: Basic Axis/Axiom usage question
>
> Axiom is a good starting way to get to know Axis2, and in fact is
> involved in many of the low level parts parts of Axis2. However, if
> its Java Collections you want, you may consider using one of the
> higher level databinding API's like adb, xmlbeans, jibx, jaxb etc.
> Those type of API's can give you Java Collections, and when used in
> Axis2 code generation, hook into Axiom anyways though at a level you
> generally don't need to worry about unless there's a bug. When using
> those with Axis2 you need an xml schema and WSDL, hand generated or
> via reverse engineering existing code.
>
> One way of looking at things is the xml payload sent over the wire is
> in Arrays suitable for any language, and not just for Java
> Collections. With databinding, the xml payload is obstenably the same
> while the code level implemetation varies widely.
>
> HTH,
> Robert
>
> On Tue, May 6, 2008 at 5:59 PM, Parham, Clinton <cp...@biosignia.com> wrote:
> >
> >
> >
> >
> > Hello.
> >
> >
> >
> > I'm getting my feet wet with Axis & Axiom and something is just not clicking
> > for me. Let's say I have a web service method that accepts and returns
> > OMElements. The web service receives some data and builds a
> > java.util.Collection of results objects that I need to send back as an XML
> > payload in the response.
> >
> >
> >
> > What is the correct (most efficient memory-wise) way to do this? Do I merely
> > use factory.createOMElement / element.addAttribute to recreate the
> > Collection objects in XML? Or, do I use something more elaborate like
> > somehow wrapping the Collection with OMSourcedElementImpl and using
> > OMDataSource?
> >
> >
> >
> > Some guidance and pointers to a similar example would be appreciated.
> >
> >
> >
> > Thank you,
> >
> > Clinton
> >
> >
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Basic Axis/Axiom usage question
Posted by "Parham, Clinton" <cp...@biosignia.com>.
Robert: thanks for your input and I will keep your suggestions about data binding in mind. That aside, how would I do this the more manual way using OMElement? I have a specific schema to adhere to and already have a Java object model in place that I have to work with.
To keep things simple, assume each object in the Collection becomes an XML element in the response payload. I want to be sure that I leverage the strengths of AXIOM/StAX and minimize memory usage.
-----Original Message-----
From: robert lazarski [mailto:robertlazarski@gmail.com]
Sent: Tuesday, May 06, 2008 6:59 PM
To: axis-user@ws.apache.org
Subject: Re: Basic Axis/Axiom usage question
Axiom is a good starting way to get to know Axis2, and in fact is
involved in many of the low level parts parts of Axis2. However, if
its Java Collections you want, you may consider using one of the
higher level databinding API's like adb, xmlbeans, jibx, jaxb etc.
Those type of API's can give you Java Collections, and when used in
Axis2 code generation, hook into Axiom anyways though at a level you
generally don't need to worry about unless there's a bug. When using
those with Axis2 you need an xml schema and WSDL, hand generated or
via reverse engineering existing code.
One way of looking at things is the xml payload sent over the wire is
in Arrays suitable for any language, and not just for Java
Collections. With databinding, the xml payload is obstenably the same
while the code level implemetation varies widely.
HTH,
Robert
On Tue, May 6, 2008 at 5:59 PM, Parham, Clinton <cp...@biosignia.com> wrote:
>
>
>
>
> Hello.
>
>
>
> I'm getting my feet wet with Axis & Axiom and something is just not clicking
> for me. Let's say I have a web service method that accepts and returns
> OMElements. The web service receives some data and builds a
> java.util.Collection of results objects that I need to send back as an XML
> payload in the response.
>
>
>
> What is the correct (most efficient memory-wise) way to do this? Do I merely
> use factory.createOMElement / element.addAttribute to recreate the
> Collection objects in XML? Or, do I use something more elaborate like
> somehow wrapping the Collection with OMSourcedElementImpl and using
> OMDataSource?
>
>
>
> Some guidance and pointers to a similar example would be appreciated.
>
>
>
> Thank you,
>
> Clinton
>
>
---------------------------------------------------------------------
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: Basic Axis/Axiom usage question
Posted by robert lazarski <ro...@gmail.com>.
Axiom is a good starting way to get to know Axis2, and in fact is
involved in many of the low level parts parts of Axis2. However, if
its Java Collections you want, you may consider using one of the
higher level databinding API's like adb, xmlbeans, jibx, jaxb etc.
Those type of API's can give you Java Collections, and when used in
Axis2 code generation, hook into Axiom anyways though at a level you
generally don't need to worry about unless there's a bug. When using
those with Axis2 you need an xml schema and WSDL, hand generated or
via reverse engineering existing code.
One way of looking at things is the xml payload sent over the wire is
in Arrays suitable for any language, and not just for Java
Collections. With databinding, the xml payload is obstenably the same
while the code level implemetation varies widely.
HTH,
Robert
On Tue, May 6, 2008 at 5:59 PM, Parham, Clinton <cp...@biosignia.com> wrote:
>
>
>
>
> Hello.
>
>
>
> I'm getting my feet wet with Axis & Axiom and something is just not clicking
> for me. Let's say I have a web service method that accepts and returns
> OMElements. The web service receives some data and builds a
> java.util.Collection of results objects that I need to send back as an XML
> payload in the response.
>
>
>
> What is the correct (most efficient memory-wise) way to do this? Do I merely
> use factory.createOMElement / element.addAttribute to recreate the
> Collection objects in XML? Or, do I use something more elaborate like
> somehow wrapping the Collection with OMSourcedElementImpl and using
> OMDataSource?
>
>
>
> Some guidance and pointers to a similar example would be appreciated.
>
>
>
> Thank you,
>
> Clinton
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org