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 José Silva <js...@ipc.pt> on 2011/06/13 15:53:01 UTC

Axis2 webservice returning ArrayList of Hashtable

Hi.

I have been using Axis1 for a long time in a simple way, just creating 
web services to retrieve some records of databases. Making the methods 
return "java.util.ArrayList" of "java.util.Hashtable" Java Objects the 
WSDL auto generated  by Axis1 was enough to consume this webservices in 
PHP with soapclient, get as a result arrays of associative arrays.
Now I'm trying to use Axis2 but the best I can do is to retrieve arrays 
of "java.util.String" or just simple data types like "int". When I try 
to return an Hashtable the result (in the browser) is something like this:

<ns:getHashResponse><ns:return><ns:empty>false</ns:empty></ns:return></ns:getHashResponse>

Based on this simple example code:

  public Hashtable<String,String> getHash()
     {
         Hashtable<String,String> h = new Hashtable<String,String>();
         h.put("nome", "Jose Silva");
         h.put("idade", "36");
         return h;
     }

I'm using Axis2 plugin to Netbeans to build the webservices. The problem 
seems to be related with the databindings, but I do not want to deal 
with WSDL directly, because I believe that "language" is "machine 
domain" not for human beings.

I want something as simple as Axis1, is that possible?

Thank's in advance to any one who can help me.

   José Silva


-- 

*José Luís Mendonça da Silva*

/Departamento de Gestão de Património e Infra-estruturas/

Email: jsilva@ipc.pt <ma...@ipc.pt>

	

**IPC***Instituto Politécnico de Coimbra |**Serviços da Presidência***

Av. Dr. Marnoco e Sousa, nº 30
3000 - 271 Coimbra
Tel.: +351 239791250 | Fax: +351 239791262
Site: www.ipc.pt <http://www.ipc.pt/>


Re: Axis2 webservice returning ArrayList of Hashtable

Posted by José Silva <js...@ipc.pt>.
Thanks.

Of course I will wait for version 1.7.0.
Thanks one more time.

   José Silva

Em 13-06-2011 16:19, Sagara Gunathunga escreveu:
>  Hi José,
>
> On Mon, Jun 13, 2011 at 8:31 PM, Sadeep Jayasumana 
> <gayansadeep@gmail.com <ma...@gmail.com>> wrote:
>
>     Hi,
>
>     This has been reported in [1]..[3]. AFAIK, Sagara is currently
>     working on them.
>
>     [1] https://issues.apache.org/jira/browse/AXIS2-5063
>     [2] https://issues.apache.org/jira/browse/AXIS2-5064
>     [3] https://issues.apache.org/jira/browse/AXIS2-5066
>
>
>
> Map support is a know limitation. BTW the  good news is you can test 
> Map support once the above issues get fixed hopefully in near future 
> but if you want to use a official released version you  have to wait 
> until Axis2 1.7.0 release.
>
> Thanks !
>
>
>     Thanks,
>     Sadeep
>
>     On Mon, Jun 13, 2011 at 7:23 PM, José Silva <jsilva@ipc.pt
>     <ma...@ipc.pt>> wrote:
>
>         Hi.
>
>         I have been using Axis1 for a long time in a simple way, just
>         creating web services to retrieve some records of databases.
>         Making the methods return "java.util.ArrayList" of
>         "java.util.Hashtable" Java Objects the WSDL auto generated  by
>         Axis1 was enough to consume this webservices in PHP with
>         soapclient, get as a result arrays of associative arrays.
>         Now I'm trying to use Axis2 but the best I can do is to
>         retrieve arrays of "java.util.String" or just simple data
>         types like "int". When I try to return an Hashtable the result
>         (in the browser) is something like this:
>
>         <ns:getHashResponse><ns:return><ns:empty>false</ns:empty></ns:return></ns:getHashResponse>
>
>         Based on this simple example code:
>
>          public Hashtable<String,String> getHash()
>             {
>                 Hashtable<String,String> h = new
>         Hashtable<String,String>();
>                 h.put("nome", "Jose Silva");
>                 h.put("idade", "36");
>                 return h;
>             }
>
>         I'm using Axis2 plugin to Netbeans to build the webservices.
>         The problem seems to be related with the databindings, but I
>         do not want to deal with WSDL directly, because I believe that
>         "language" is "machine domain" not for human beings.
>
>         I want something as simple as Axis1, is that possible?
>
>         Thank's in advance to any one who can help me.
>
>           José Silva
>
>
>         -- 
>
>         *José Luís Mendonça da Silva*
>
>         /Departamento de Gestão de Património e Infra-estruturas/
>
>         Email: jsilva@ipc.pt <ma...@ipc.pt>
>
>         	
>
>         **IPC***Instituto Politécnico de Coimbra |**Serviços da
>         Presidência***
>
>         Av. Dr. Marnoco e Sousa, nº 30
>         3000 - 271 Coimbra
>         Tel.: +351 239791250 <tel:%2B351%20239791250> | Fax: +351
>         239791262 <tel:%2B351%20239791262>
>         Site: www.ipc.pt <http://www.ipc.pt/>
>
>
>
>
>     -- 
>     Sadeep
>
>
>
>
> -- 
> Sagara Gunathunga
>
> Blog      - http://ssagara.blogspot.com
> Web      - http://people.apache.org/~sagara/ 
> <http://people.apache.org/%7Esagara/>
> LinkedIn - http://www.linkedin.com/in/ssagara


-- 

*José Luís Mendonça da Silva*

/Departamento de Gestão de Património e Infra-estruturas/

Email: jsilva@ipc.pt <ma...@ipc.pt>

	

**IPC***Instituto Politécnico de Coimbra |**Serviços da Presidência***

Av. Dr. Marnoco e Sousa, nº 30
3000 - 271 Coimbra
Tel.: +351 239791250 | Fax: +351 239791262
Site: www.ipc.pt <http://www.ipc.pt/>


Re: Axis2 webservice returning ArrayList of Hashtable

Posted by Sagara Gunathunga <sa...@gmail.com>.
 Hi José,

On Mon, Jun 13, 2011 at 8:31 PM, Sadeep Jayasumana <ga...@gmail.com>wrote:

> Hi,
>
> This has been reported in [1]..[3]. AFAIK, Sagara is currently working on
> them.
>
> [1] https://issues.apache.org/jira/browse/AXIS2-5063
> [2] https://issues.apache.org/jira/browse/AXIS2-5064
>  <https://issues.apache.org/jira/browse/AXIS2-5064>[3]
> https://issues.apache.org/jira/browse/AXIS2-5066
>


Map support is a know limitation. BTW the  good news is you can test Map
support once the above issues get fixed hopefully in near future but if you
want to use a official released version you  have to wait until Axis2 1.7.0
release.

Thanks !


>
> Thanks,
> Sadeep
>
> On Mon, Jun 13, 2011 at 7:23 PM, José Silva <js...@ipc.pt> wrote:
>
>> **
>> Hi.
>>
>> I have been using Axis1 for a long time in a simple way, just creating web
>> services to retrieve some records of databases. Making the methods return
>> "java.util.ArrayList" of "java.util.Hashtable" Java Objects the WSDL auto
>> generated  by Axis1 was enough to consume this webservices in PHP with
>> soapclient, get as a result arrays of associative arrays.
>> Now I'm trying to use Axis2 but the best I can do is to retrieve arrays of
>> "java.util.String" or just simple data types like "int". When I try to
>> return an Hashtable the result (in the browser) is something like this:
>>
>>
>> <ns:getHashResponse><ns:return><ns:empty>false</ns:empty></ns:return></ns:getHashResponse>
>>
>> Based on this simple example code:
>>
>>  public Hashtable<String,String> getHash()
>>     {
>>         Hashtable<String,String> h = new Hashtable<String,String>();
>>         h.put("nome", "Jose Silva");
>>         h.put("idade", "36");
>>         return h;
>>     }
>>
>> I'm using Axis2 plugin to Netbeans to build the webservices. The problem
>> seems to be related with the databindings, but I do not want to deal with
>> WSDL directly, because I believe that "language" is "machine domain" not for
>> human beings.
>>
>> I want something as simple as Axis1, is that possible?
>>
>> Thank's in advance to any one who can help me.
>>
>>   José Silva
>>
>>
>> --
>>
>> * José Luís Mendonça da Silva*
>>
>> * Departamento de Gestão de Património e Infra-estruturas*
>>
>>  Email:  jsilva@ipc.pt
>>
>>
>> * *[image: IPC]* **Instituto Politécnico de Coimbra |* *Serviços da
>> Presidência** *
>>
>> Av. Dr. Marnoco e Sousa, nº 30
>> 3000 - 271 Coimbra  ****
>> Tel.: +351 239791250 | Fax: +351 239791262****
>> Site: www.ipc.pt****
>>
>> ** **
>>
>> ** **
>>
>
>
>
> --
> Sadeep
>



-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

Re: Axis2 webservice returning ArrayList of Hashtable

Posted by Sadeep Jayasumana <ga...@gmail.com>.
Hi,

This has been reported in [1]..[3]. AFAIK, Sagara is currently working on
them.

[1] https://issues.apache.org/jira/browse/AXIS2-5063
[2] https://issues.apache.org/jira/browse/AXIS2-5064
<https://issues.apache.org/jira/browse/AXIS2-5064>[3]
https://issues.apache.org/jira/browse/AXIS2-5066

Thanks,
Sadeep

On Mon, Jun 13, 2011 at 7:23 PM, José Silva <js...@ipc.pt> wrote:

> **
> Hi.
>
> I have been using Axis1 for a long time in a simple way, just creating web
> services to retrieve some records of databases. Making the methods return
> "java.util.ArrayList" of "java.util.Hashtable" Java Objects the WSDL auto
> generated  by Axis1 was enough to consume this webservices in PHP with
> soapclient, get as a result arrays of associative arrays.
> Now I'm trying to use Axis2 but the best I can do is to retrieve arrays of
> "java.util.String" or just simple data types like "int". When I try to
> return an Hashtable the result (in the browser) is something like this:
>
>
> <ns:getHashResponse><ns:return><ns:empty>false</ns:empty></ns:return></ns:getHashResponse>
>
> Based on this simple example code:
>
>  public Hashtable<String,String> getHash()
>     {
>         Hashtable<String,String> h = new Hashtable<String,String>();
>         h.put("nome", "Jose Silva");
>         h.put("idade", "36");
>         return h;
>     }
>
> I'm using Axis2 plugin to Netbeans to build the webservices. The problem
> seems to be related with the databindings, but I do not want to deal with
> WSDL directly, because I believe that "language" is "machine domain" not for
> human beings.
>
> I want something as simple as Axis1, is that possible?
>
> Thank's in advance to any one who can help me.
>
>   José Silva
>
>
> --
>
> * José Luís Mendonça da Silva*
>
> * Departamento de Gestão de Património e Infra-estruturas*
>
>  Email:  jsilva@ipc.pt
>
>
> * *[image: IPC]* **Instituto Politécnico de Coimbra |* *Serviços da
> Presidência** *
>
> Av. Dr. Marnoco e Sousa, nº 30
> 3000 - 271 Coimbra  ****
> Tel.: +351 239791250 | Fax: +351 239791262****
> Site: www.ipc.pt****
>
> ** **
>
> ** **
>



-- 
Sadeep