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 George H <ge...@gmail.com> on 2007/09/07 22:47:51 UTC

Tips on sending java objects via axis2

I am in the need to send back and forth some custom java objects I
created (some have vectors and hash maps in them.)

I used to solve this in the past (using apache's soap api and xstream)
by converting the class to xml and sending it as  a String. This
doesn't seem to work with axis and gives me errors.. probably because
the object is serialized as xml. So I am serializing it into an array
of bytes using JBoss serializer and sending them.

My question.. is this good practice? Is there a better way of going
about sending java objects through axis2?  I use the eclipse plugin
tools to create my webservices so I am limited to that.

Thanks.
-- 
"Nothing is impossible for the person that doesn't have to do it"
"The probability of anything happening is in inverse ratio to its desirability"
"The problem is not freedom of choice, it is about the choices you
have. Choice is always limited by the number of alternatives presented
to you"
--
George H
george.dma@gmail.com

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


Re: Tips on sending java objects via axis2

Posted by George H <ge...@gmail.com>.
Alright, I'll look into what you said about creating configuration
files for my java classes. So far i'll use byte arrays to send back
and forth my java classes, it seems to work and you know what they say
"if it ain't broke don't fix it."

Would you know which docs are the best to read for mastering axis2 in
regards of what you said?

Thanks.

On 9/8/07, Ebert, Chris <ch...@hp.com> wrote:
> Probably not. The point of SOAP (and other XML based protocols) is to be implementation independent. Java serialization is definitely not independent and can cause surprising failures. I work with Axis 1.2, so I can't give advice on axis2, but I use complex types and you too should be able to work it out. I would suggest using the tools to generate the axis2 configuration files from your java classes. If you can't use 'em directly they'll at least give you a place to start. I found with Axis 1.2 this worked OK, and eventually led to a solution to the problems I had.
> That said, the errors Axis 1.2 gives because of bad configuration were very difficult to interpret. I hope axis2 is better in that regard.
>
> Chris
>
> -----Original Message-----
> From: George H [mailto:george.dma@gmail.com]
> Sent: Friday, September 07, 2007 13:48
> To: axis-user@ws.apache.org
> Subject: Tips on sending java objects via axis2
>
> I am in the need to send back and forth some custom java objects I created (some have vectors and hash maps in them.)
>
> I used to solve this in the past (using apache's soap api and xstream) by converting the class to xml and sending it as  a String. This doesn't seem to work with axis and gives me errors.. probably because the object is serialized as xml. So I am serializing it into an array of bytes using JBoss serializer and sending them.
>
> My question.. is this good practice? Is there a better way of going about sending java objects through axis2?  I use the eclipse plugin tools to create my webservices so I am limited to that.
>
> Thanks.
> --
> "Nothing is impossible for the person that doesn't have to do it"
> "The probability of anything happening is in inverse ratio to its desirability"
> "The problem is not freedom of choice, it is about the choices you have. Choice is always limited by the number of alternatives presented to you"
> --
> George H
> george.dma@gmail.com

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


RE: Tips on sending java objects via axis2

Posted by "Ebert, Chris" <ch...@hp.com>.
Probably not. The point of SOAP (and other XML based protocols) is to be implementation independent. Java serialization is definitely not independent and can cause surprising failures. I work with Axis 1.2, so I can't give advice on axis2, but I use complex types and you too should be able to work it out. I would suggest using the tools to generate the axis2 configuration files from your java classes. If you can't use 'em directly they'll at least give you a place to start. I found with Axis 1.2 this worked OK, and eventually led to a solution to the problems I had.
That said, the errors Axis 1.2 gives because of bad configuration were very difficult to interpret. I hope axis2 is better in that regard.

Chris

-----Original Message-----
From: George H [mailto:george.dma@gmail.com]
Sent: Friday, September 07, 2007 13:48
To: axis-user@ws.apache.org
Subject: Tips on sending java objects via axis2

I am in the need to send back and forth some custom java objects I created (some have vectors and hash maps in them.)

I used to solve this in the past (using apache's soap api and xstream) by converting the class to xml and sending it as  a String. This doesn't seem to work with axis and gives me errors.. probably because the object is serialized as xml. So I am serializing it into an array of bytes using JBoss serializer and sending them.

My question.. is this good practice? Is there a better way of going about sending java objects through axis2?  I use the eclipse plugin tools to create my webservices so I am limited to that.

Thanks.
--
"Nothing is impossible for the person that doesn't have to do it"
"The probability of anything happening is in inverse ratio to its desirability"
"The problem is not freedom of choice, it is about the choices you have. Choice is always limited by the number of alternatives presented to you"
--
George H
george.dma@gmail.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: Tips on sending java objects via axis2

Posted by Deepal jayasinghe <de...@gmail.com>.
George H wrote:
> I am in the need to send back and forth some custom java objects I
> created (some have vectors and hash maps in them.)
>
> I used to solve this in the past (using apache's soap api and xstream)
> by converting the class to xml and sending it as  a String. This
> doesn't seem to work with axis and gives me errors.. probably because
> the object is serialized as xml. So I am serializing it into an array
> of bytes using JBoss serializer and sending them.
>
> My question.. is this good practice? Is there a better way of going
> about sending java objects through axis2?  I use the eclipse plugin
> tools to create my webservices so I am limited to that.
>   
You can use RPCServiceClient in axis2 to send java object.

Thanks
Deepal


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