You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Chatree Srichart <ch...@gmail.com> on 2009/11/27 12:01:37 UTC

Axis2: I can not send Map object as parameter.

I would like to send Map object as SOAP message. I try to create OMElement
by send Map object in array like this...

OMElement payload = BeanUtil.getOMElement(
serviceName, new Object[] {mapObject}, null, false, typeTable);

But I got...

<serviceName><arg0>paramName</arg0><arg1 xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns1:Map"></arg1></serviceName>

So, the arg1 should has content like this...

<item>
    <key>firstName</key>
    <value>AAA</value>
    <key>lastName</key>
    <value>BBBB</value>
</item>

but it empty.

Because I would like to migrate from Axis to Axis2. In Axis I use ..

result = call.invoke(params)

It work fine.

Because OFBiz's service need java.util.Map object as IN/OUT parameter

Please any one tell me how should I do?

Thank you...

Re: Axis2: I can not send Map object as parameter.

Posted by Chatree Srichart <ch...@gmail.com>.
I received message from Axis mailing list.

"Axis2 does not support POJO services containing Java collections, abstract
types or generics. You will have to use object arrays, or start with the
WSDL and then generate the server side code for it."

I think I have to generate code for serialize Map object and all types that
OFBiz supported.

Re: Axis2: I can not send Map object as parameter.

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Chatree,

I know Map is not Array, but did you look into this https://issues.apache.org/jira/browse/OFBIZ-1008

Jacques

From: "Chatree Srichart" <ch...@gmail.com>
>I would like to send Map object as SOAP message. I try to create OMElement
> by send Map object in array like this...
> 
> OMElement payload = BeanUtil.getOMElement(
> serviceName, new Object[] {mapObject}, null, false, typeTable);
> 
> But I got...
> 
> <serviceName><arg0>paramName</arg0><arg1 xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="ns1:Map"></arg1></serviceName>
> 
> So, the arg1 should has content like this...
> 
> <item>
>    <key>firstName</key>
>    <value>AAA</value>
>    <key>lastName</key>
>    <value>BBBB</value>
> </item>
> 
> but it empty.
> 
> Because I would like to migrate from Axis to Axis2. In Axis I use ..
> 
> result = call.invoke(params)
> 
> It work fine.
> 
> Because OFBiz's service need java.util.Map object as IN/OUT parameter
> 
> Please any one tell me how should I do?
> 
> Thank you...
>