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 Sagara Gunathunga <sa...@gmail.com> on 2008/10/27 09:22:39 UTC

[AXIS2] WSDL2Java problem with array type

Hi guys ,

I have deployed a POJO service that has a method something slimier to
following signature

         * public long createUser (UserProfile pr , Contacts[] contacts){
}*

where UserProfile and Contacts are  POJOs , this will generate  correct
WSDL file. but when I created a WS client using WSDL2JAVA tool with default
ADB binding, It genarate   both of above POJO classes . Also another class
called *Collection* that extended from *ADBBean* .

1.) AddContacts(Collection col) take  Collection as a argument, but there is
no method define inside the Collection class to set Array of Contacts or to
set any implementation  of Java.util. Collection , How can I include set of
Contacts objects in to request ....?

2.) Can I solve this problem by using any other data binding option....?


Thanks ,

Sagara Gunathunga

Blog - ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

Re: [AXIS2] WSDL2Java problem with array type

Posted by Amila Suriarachchi <am...@gmail.com>.
On Fri, Oct 31, 2008 at 5:59 PM, Sagara Gunathunga <
sagara.gunathunga@gmail.com> wrote:

> Hi Amila,
>
> Actually we exposed  some  of  Spring  based services with Spring AOP
> transaction supports ( which provide cglib proxy objects)  , also  we have
> complex object model originally developed to use with Hibernate , So I
> create  a small  abstraction layer top of the Spring services , then
> WSDL2Java generate the correct stub methods  to handle  Arrays also .
>
> Now it's work fine with our application , any how I notice following thing
> ..
>
> we have following  method exposed as WS operation
>
> public long CreateUser(MerchantUser merchantUser, MerchantProfile
> merchantProfile, String profileType,
>             String userType, String userStatus, Contact[] contacts)
>
> in the MerchantUser class we have a java.util.Collection with generic
> (private Collection<Contact> contact)

AFAIK  Axis2 Pojo does not support collection API. and generics.

thanks,
Amila.

>
> in generated client  still  I can see class called *Collection* that
> extended from *ADBBean* and cant use that class for anything useful , I
> think this is a known limitation of AXIS2 , I'm not sure do I have to open
> a JIRA for this ..?
>
>
> Thanks ,
>
>
> On Fri, Oct 31, 2008 at 5:23 PM, Amila Suriarachchi <
> amilasuriarachchi@gmail.com> wrote:
>
>>
>>
>> On Mon, Oct 27, 2008 at 1:52 PM, Sagara Gunathunga <
>> sagara.gunathunga@gmail.com> wrote:
>>
>>>
>>> Hi guys ,
>>>
>>> I have deployed a POJO service that has a method something slimier to
>>> following signature
>>>
>>>          * public long createUser (UserProfile pr , Contacts[]
>>> contacts){
>>> }*
>>>
>>> where UserProfile and Contacts are  POJOs , this will generate  correct
>>> WSDL file. but when I created a WS client using WSDL2JAVA tool with default
>>> ADB binding, It genarate   both of above POJO classes . Also another class
>>> called *Collection* that extended from *ADBBean* .
>>>
>>> 1.) AddContacts(Collection col) take  Collection as a argument, but there
>>> is no method define inside the Collection class to set Array of Contacts or
>>> to set any implementation  of Java.util. Collection , How can I include set
>>> of  Contacts objects in to request ....?
>>
>>
>> could you please send your wsdl. please create a jira with the wsdl.
>>
>> 2.) Can I solve this problem by using any other data binding option....?
>>
>>
>> Please try. you can change the databinding uisng  -d option
>> i.e  -d jaxbri , -d xmlbeans
>>
>> thanks,
>> Amila.
>>
>>>
>>>
>>>
>>> Thanks ,
>>>
>>> Sagara Gunathunga
>>>
>>> Blog - ssagara.blogspot.com
>>> Web - http://sagaras.awardspace.com/
>>>
>>
>>
>>
>> --
>> Amila Suriarachchi
>> WSO2 Inc.
>> blog: http://amilachinthaka.blogspot.com/
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog - ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: [AXIS2] WSDL2Java problem with array type

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

Actually we exposed  some  of  Spring  based services with Spring AOP
transaction supports ( which provide cglib proxy objects)  , also  we have
complex object model originally developed to use with Hibernate , So I
create  a small  abstraction layer top of the Spring services , then
WSDL2Java generate the correct stub methods  to handle  Arrays also .

Now it's work fine with our application , any how I notice following thing
..

we have following  method exposed as WS operation

public long CreateUser(MerchantUser merchantUser, MerchantProfile
merchantProfile, String profileType,
            String userType, String userStatus, Contact[] contacts)

in the MerchantUser class we have a java.util.Collection with generic
(private Collection<Contact> contact)
in generated client  still  I can see class called *Collection* that
extended from *ADBBean* and cant use that class for anything useful , I
think this is a known limitation of AXIS2 , I'm not sure do I have to open
a JIRA for this ..?


Thanks ,


On Fri, Oct 31, 2008 at 5:23 PM, Amila Suriarachchi <
amilasuriarachchi@gmail.com> wrote:

>
>
> On Mon, Oct 27, 2008 at 1:52 PM, Sagara Gunathunga <
> sagara.gunathunga@gmail.com> wrote:
>
>>
>> Hi guys ,
>>
>> I have deployed a POJO service that has a method something slimier to
>> following signature
>>
>>          * public long createUser (UserProfile pr , Contacts[] contacts){
>> }*
>>
>> where UserProfile and Contacts are  POJOs , this will generate  correct
>> WSDL file. but when I created a WS client using WSDL2JAVA tool with default
>> ADB binding, It genarate   both of above POJO classes . Also another class
>> called *Collection* that extended from *ADBBean* .
>>
>> 1.) AddContacts(Collection col) take  Collection as a argument, but there
>> is no method define inside the Collection class to set Array of Contacts or
>> to set any implementation  of Java.util. Collection , How can I include set
>> of  Contacts objects in to request ....?
>
>
> could you please send your wsdl. please create a jira with the wsdl.
>
> 2.) Can I solve this problem by using any other data binding option....?
>
>
> Please try. you can change the databinding uisng  -d option
> i.e  -d jaxbri , -d xmlbeans
>
> thanks,
> Amila.
>
>>
>>
>>
>> Thanks ,
>>
>> Sagara Gunathunga
>>
>> Blog - ssagara.blogspot.com
>> Web - http://sagaras.awardspace.com/
>>
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>



-- 
Sagara Gunathunga

Blog - ssagara.blogspot.com
Web - http://sagaras.awardspace.com/

Re: [AXIS2] WSDL2Java problem with array type

Posted by Amila Suriarachchi <am...@gmail.com>.
On Mon, Oct 27, 2008 at 1:52 PM, Sagara Gunathunga <
sagara.gunathunga@gmail.com> wrote:

>
> Hi guys ,
>
> I have deployed a POJO service that has a method something slimier to
> following signature
>
>          * public long createUser (UserProfile pr , Contacts[] contacts){
> }*
>
> where UserProfile and Contacts are  POJOs , this will generate  correct
> WSDL file. but when I created a WS client using WSDL2JAVA tool with default
> ADB binding, It genarate   both of above POJO classes . Also another class
> called *Collection* that extended from *ADBBean* .
>
> 1.) AddContacts(Collection col) take  Collection as a argument, but there
> is no method define inside the Collection class to set Array of Contacts or
> to set any implementation  of Java.util. Collection , How can I include set
> of  Contacts objects in to request ....?


could you please send your wsdl. please create a jira with the wsdl.

2.) Can I solve this problem by using any other data binding option....?


Please try. you can change the databinding uisng  -d option
i.e  -d jaxbri , -d xmlbeans

thanks,
Amila.

>
>
>
> Thanks ,
>
> Sagara Gunathunga
>
> Blog - ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: [AXIS2] WSDL2Java problem with array type

Posted by Deepal jayasinghe <de...@gmail.com>.
Hi Sagara ,
Hmm ,then it should be a problem with ADB , let's wait till Amila reply
to this or create a JIRA attaching the WSDL.

Thank you!
Deepal
>
> Hi guys ,
>
> I have deployed a POJO service that has a method something slimier to
> following signature
>
>          / public long createUser (UserProfile pr , Contacts[] contacts){
> }/
>
> where UserProfile and Contacts are  POJOs , this will generate 
> correct   WSDL file. but when I created a WS client using WSDL2JAVA
> tool with default ADB binding, It genarate   both of above POJO
> classes . Also another class called *Collection* that extended from
> *ADBBean* .
>
> 1.) AddContacts(Collection col) take  Collection as a argument, but
> there is no method define inside the Collection class to set Array of
> Contacts or to set any implementation  of Java.util. Collection , How
> can I include set of  Contacts objects in to request ....?
>
> 2.) Can I solve this problem by using any other data binding option....?
>
>
> Thanks ,
>
> Sagara Gunathunga
>
> Blog - ssagara.blogspot.com <http://ssagara.blogspot.com>
> Web - http://sagaras.awardspace.com/


-- 
Thank you!


http://blogs.deepal.org


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