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 scott <sc...@evolove.net> on 2003/09/03 14:34:15 UTC
help with sending a struct
Hey guys,
Been reading the soap spec and a struct looks like a great way to send key/value
pairs of strings to a soap server. For example, I want to send:
"username" => "bob smith"
"hobbies" => "fishing, bike riding, skiing"
Now, how can I achieve this in axis? I have a sample .jws server set up for my
client to test with, but I don't know how to actually send/receive this data, as
most examples in the axis samples are very basic int/string parameters
(send/receive).
The bidbuy example seems to send java objects, does that mean axis is
responsible for turning that into base SOAP data types? I see that the client uses:
// register the PurchaseOrder class
QName poqn = new QName("http://www.soapinterop.org/Bid", "PurchaseOrder");
Class cls = PurchaseOrder.class;
call.registerTypeMapping(cls, poqn, BeanSerializerFactory.class,
BeanDeserializerFactory.class);
...
call.addParameter( "PO", poqn, ParameterMode.IN );
Will I have to do something similar? That looks a bit complex for what I want to
do? It also only gets back a string, I want to get back key/value pairs.
Any tips/code examples welcome!
thanks,
Scott
Re: help with sending a struct
Posted by Benjamin Tomasini <bt...@neteverything.com>.
I would make your struct into a bean, and declare the bean type using
the BeanSerialzer
On Wed, 2003-09-03 at 08:34, scott wrote:
> Hey guys,
>
> Been reading the soap spec and a struct looks like a great way to send key/value
> pairs of strings to a soap server. For example, I want to send:
>
> "username" => "bob smith"
> "hobbies" => "fishing, bike riding, skiing"
>
> Now, how can I achieve this in axis? I have a sample .jws server set up for my
> client to test with, but I don't know how to actually send/receive this data, as
> most examples in the axis samples are very basic int/string parameters
> (send/receive).
>
> The bidbuy example seems to send java objects, does that mean axis is
> responsible for turning that into base SOAP data types? I see that the client uses:
>
> // register the PurchaseOrder class
> QName poqn = new QName("http://www.soapinterop.org/Bid", "PurchaseOrder");
> Class cls = PurchaseOrder.class;
> call.registerTypeMapping(cls, poqn, BeanSerializerFactory.class,
> BeanDeserializerFactory.class);
> ...
> call.addParameter( "PO", poqn, ParameterMode.IN );
>
> Will I have to do something similar? That looks a bit complex for what I want to
> do? It also only gets back a string, I want to get back key/value pairs.
>
> Any tips/code examples welcome!
>
> thanks,
> Scott
--
Benjamin Tomasini
NetEverything, Inc.
1-877-270-1391