You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Rahul_Ravikumar <ti...@gmail.com> on 2008/05/24 00:54:37 UTC

Array Of Unbound Types

I am trying to use CXF which is an implementation of JAX-WS and use the JAXB
framework for binding. I my WDSL i have defined a number of complex types
that are "ArrayOf<Types>". For e.g.

<xs:complexType name="ArrayOfString">
<xs:annotation>
<xs:appinfo>
<jaxb roperty collectionType="indexed"/>
</xs:appinfo>
<xs ocumentation>An object for holding a String array.</xs ocumentation>
</xs:annotation>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="String"
type="xs:string" />
</xs:sequence>
</xs:complexType>

In Axis 1.4, this "ArrayOfString" type gets mapped to String []. However
when i use CXF it generates an ArrayOfString class that consists of a member
List<String> accessible through getter methods.

I would however like to map ArrayOfTypes to Type [] or List<Type>. I read
some of the documentation and it was suggested that i use the <jaxb roperty
collectionType="indexed"/> when defining the complex type. But this does NOT
help. The WSDL2Java still generates a ArrayOfType class.

Can someone please help me out?
-- 
View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Array Of Unbound Types

Posted by Daniel Kulp <dk...@apache.org>.
On May 24, 2008, at 9:44 PM, Benson Margulies wrote:

> Can you post an entire WSDL? I'm wondering if you have the jaxb
> namespace turned on, and a few other things.
>
> I am not 100% confident that CXF will handle jaxb annotations in the
> WSDL, as opposed to making a separate JAXB binding file.

Well, I can clarify this one....    CXF can definitely handle this.    
This is actually how it's done internally.   The JAXB binding files  
are merged into DOM versions of the WSDL/schema before calling off to  
xjc.   Thus, stuff that is in the xsd should be picked up fine.

Dan


>
>
> On Fri, May 23, 2008 at 7:11 PM, Rahul_Ravikumar  
> <ti...@gmail.com> wrote:
>>
>> I am sorry, that there was a typo. The XML fragment actually looks  
>> like this:
>>
>> <xs:complexType name="ArrayOfString">
>>       <xs:annotation>
>>               <xs:appinfo>
>>                       <jaxb:property collectionType="indexed" />
>>               </xs:appinfo>
>>               <xs:documentation>An object for holding a String
>> array.</xs:documentation>
>>       </xs:annotation>
>>       <xs:sequence>
>>         <xs:element form="qualified" maxOccurs="unbounded"  
>> name="String"
>> type="xs:string" />
>>       </xs:sequence>
>>     </xs:complexType>
>>
>> "<jaxb:property collectionType="indexed" /> " was not in the  
>> documentation.
>> I read about it at
>> (http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04004.html 
>> )
>>
>>
>>
>> Benson Margulies-4 wrote:
>>>
>>> Did you really mean <jaxb roperty collectionType='indexed'/> Where  
>>> did
>>> you find this documentation?
>>>
>>> On Fri, May 23, 2008 at 6:54 PM, Rahul_Ravikumar <tikurahul@gmail.com 
>>> >
>>> wrote:
>>>>
>>>> I am trying to use CXF which is an implementation of JAX-WS and  
>>>> use the
>>>> JAXB
>>>> framework for binding. I my WDSL i have defined a number of  
>>>> complex types
>>>> that are "ArrayOf<Types>". For e.g.
>>>>
>>>> <xs:complexType name="ArrayOfString">
>>>> <xs:annotation>
>>>> <xs:appinfo>
>>>> <jaxb roperty collectionType="indexed"/>
>>>> </xs:appinfo>
>>>> <xs ocumentation>An object for holding a String array.</xs  
>>>> ocumentation>
>>>> </xs:annotation>
>>>> <xs:sequence>
>>>> <xs:element minOccurs="0" maxOccurs="unbounded" name="String"
>>>> type="xs:string" />
>>>> </xs:sequence>
>>>> </xs:complexType>
>>>>
>>>> In Axis 1.4, this "ArrayOfString" type gets mapped to String [].  
>>>> However
>>>> when i use CXF it generates an ArrayOfString class that consists  
>>>> of a
>>>> member
>>>> List<String> accessible through getter methods.
>>>>
>>>> I would however like to map ArrayOfTypes to Type [] or  
>>>> List<Type>. I read
>>>> some of the documentation and it was suggested that i use the <jaxb
>>>> roperty
>>>> collectionType="indexed"/> when defining the complex type. But  
>>>> this does
>>>> NOT
>>>> help. The WSDL2Java still generates a ArrayOfType class.
>>>>
>>>> Can someone please help me out?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442502.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Re: Array Of Unbound Types

Posted by Benson Margulies <bi...@gmail.com>.
Can you post an entire WSDL? I'm wondering if you have the jaxb
namespace turned on, and a few other things.

I am not 100% confident that CXF will handle jaxb annotations in the
WSDL, as opposed to making a separate JAXB binding file.

On Fri, May 23, 2008 at 7:11 PM, Rahul_Ravikumar <ti...@gmail.com> wrote:
>
> I am sorry, that there was a typo. The XML fragment actually looks like this:
>
> <xs:complexType name="ArrayOfString">
>        <xs:annotation>
>                <xs:appinfo>
>                        <jaxb:property collectionType="indexed" />
>                </xs:appinfo>
>                <xs:documentation>An object for holding a String
> array.</xs:documentation>
>        </xs:annotation>
>        <xs:sequence>
>          <xs:element form="qualified" maxOccurs="unbounded" name="String"
> type="xs:string" />
>        </xs:sequence>
>      </xs:complexType>
>
> "<jaxb:property collectionType="indexed" /> " was not in the documentation.
> I read about it at
> (http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04004.html)
>
>
>
> Benson Margulies-4 wrote:
>>
>> Did you really mean <jaxb roperty collectionType='indexed'/> Where did
>> you find this documentation?
>>
>> On Fri, May 23, 2008 at 6:54 PM, Rahul_Ravikumar <ti...@gmail.com>
>> wrote:
>>>
>>> I am trying to use CXF which is an implementation of JAX-WS and use the
>>> JAXB
>>> framework for binding. I my WDSL i have defined a number of complex types
>>> that are "ArrayOf<Types>". For e.g.
>>>
>>> <xs:complexType name="ArrayOfString">
>>> <xs:annotation>
>>> <xs:appinfo>
>>> <jaxb roperty collectionType="indexed"/>
>>> </xs:appinfo>
>>> <xs ocumentation>An object for holding a String array.</xs ocumentation>
>>> </xs:annotation>
>>> <xs:sequence>
>>> <xs:element minOccurs="0" maxOccurs="unbounded" name="String"
>>> type="xs:string" />
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> In Axis 1.4, this "ArrayOfString" type gets mapped to String []. However
>>> when i use CXF it generates an ArrayOfString class that consists of a
>>> member
>>> List<String> accessible through getter methods.
>>>
>>> I would however like to map ArrayOfTypes to Type [] or List<Type>. I read
>>> some of the documentation and it was suggested that i use the <jaxb
>>> roperty
>>> collectionType="indexed"/> when defining the complex type. But this does
>>> NOT
>>> help. The WSDL2Java still generates a ArrayOfType class.
>>>
>>> Can someone please help me out?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442502.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Array Of Unbound Types

Posted by Rahul_Ravikumar <ti...@gmail.com>.
I am sorry, that there was a typo. The XML fragment actually looks like this:

<xs:complexType name="ArrayOfString">
    	<xs:annotation>
        	<xs:appinfo>
        		<jaxb:property collectionType="indexed" /> 
        	</xs:appinfo>
          	<xs:documentation>An object for holding a String
array.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
          <xs:element form="qualified" maxOccurs="unbounded" name="String"
type="xs:string" />
        </xs:sequence>
      </xs:complexType>

"<jaxb:property collectionType="indexed" /> " was not in the documentation.
I read about it at 
(http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04004.html)



Benson Margulies-4 wrote:
> 
> Did you really mean <jaxb roperty collectionType='indexed'/> Where did
> you find this documentation?
> 
> On Fri, May 23, 2008 at 6:54 PM, Rahul_Ravikumar <ti...@gmail.com>
> wrote:
>>
>> I am trying to use CXF which is an implementation of JAX-WS and use the
>> JAXB
>> framework for binding. I my WDSL i have defined a number of complex types
>> that are "ArrayOf<Types>". For e.g.
>>
>> <xs:complexType name="ArrayOfString">
>> <xs:annotation>
>> <xs:appinfo>
>> <jaxb roperty collectionType="indexed"/>
>> </xs:appinfo>
>> <xs ocumentation>An object for holding a String array.</xs ocumentation>
>> </xs:annotation>
>> <xs:sequence>
>> <xs:element minOccurs="0" maxOccurs="unbounded" name="String"
>> type="xs:string" />
>> </xs:sequence>
>> </xs:complexType>
>>
>> In Axis 1.4, this "ArrayOfString" type gets mapped to String []. However
>> when i use CXF it generates an ArrayOfString class that consists of a
>> member
>> List<String> accessible through getter methods.
>>
>> I would however like to map ArrayOfTypes to Type [] or List<Type>. I read
>> some of the documentation and it was suggested that i use the <jaxb
>> roperty
>> collectionType="indexed"/> when defining the complex type. But this does
>> NOT
>> help. The WSDL2Java still generates a ArrayOfType class.
>>
>> Can someone please help me out?
>> --
>> View this message in context:
>> http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442502.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Array Of Unbound Types

Posted by Benson Margulies <bi...@gmail.com>.
Did you really mean <jaxb roperty collectionType='indexed'/> Where did
you find this documentation?

On Fri, May 23, 2008 at 6:54 PM, Rahul_Ravikumar <ti...@gmail.com> wrote:
>
> I am trying to use CXF which is an implementation of JAX-WS and use the JAXB
> framework for binding. I my WDSL i have defined a number of complex types
> that are "ArrayOf<Types>". For e.g.
>
> <xs:complexType name="ArrayOfString">
> <xs:annotation>
> <xs:appinfo>
> <jaxb roperty collectionType="indexed"/>
> </xs:appinfo>
> <xs ocumentation>An object for holding a String array.</xs ocumentation>
> </xs:annotation>
> <xs:sequence>
> <xs:element minOccurs="0" maxOccurs="unbounded" name="String"
> type="xs:string" />
> </xs:sequence>
> </xs:complexType>
>
> In Axis 1.4, this "ArrayOfString" type gets mapped to String []. However
> when i use CXF it generates an ArrayOfString class that consists of a member
> List<String> accessible through getter methods.
>
> I would however like to map ArrayOfTypes to Type [] or List<Type>. I read
> some of the documentation and it was suggested that i use the <jaxb roperty
> collectionType="indexed"/> when defining the complex type. But this does NOT
> help. The WSDL2Java still generates a ArrayOfType class.
>
> Can someone please help me out?
> --
> View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Re: Array Of Unbound Types

Posted by Daniel Kulp <dk...@apache.org>.
On May 27, 2008, at 12:54 PM, Rahul_Ravikumar wrote:

>
> To clarify:
>
> The original WSDL is at http://geog.tamu.edu/~rahul/XML/ 
> GPServer_1.xml.
>
> The one that i had modified to make solve the problem, by promoting  
> the
> ArrayOfString type to an unbound string is at
> http://geog.tamu.edu/~rahul/XML/GPServer.xml.
>
> I am posting both, as some had questions on whether i had included  
> the jaxb
> namespace correctly.
>
> I have solved this problem, but i was wondering if this could be done
> without modifying the wsdl?


I don't think so.   This is a JAXB specification thing and not  
something CXF really has any control over.  We delegate the jaxb  
databinding stuff directly to the JAXB RI from sun.   We don't do any  
processing at that level.   It's all them.    I did some searches on  
the JAXB forum and didn't see anything there as well.   You would need  
to address any questions about the jaxb databinding mappings to them.

Dan



>
>
>
> Rahul Ravikumar wrote:
>>
>>
>> I understand that one of the ways of solving this problem is to  
>> promote
>> the "ArrayOfString" to an unbound "xs:string". But one of the  
>> restrictions
>> of this project, is that i must NOT change the WSDL. Is there any  
>> other
>> way that i can solve this problem?
>>
>> The WSDL is located at: http://geog.tamu.edu/~rahul/XML/GPServer.xml
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17495080.html
> Sent from the cxf-user mailing list archive at Nabble.com.

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Re: Array Of Unbound Types

Posted by Rahul_Ravikumar <ti...@gmail.com>.
To clarify:

The original WSDL is at http://geog.tamu.edu/~rahul/XML/GPServer_1.xml. 

The one that i had modified to make solve the problem, by promoting the
ArrayOfString type to an unbound string is at
http://geog.tamu.edu/~rahul/XML/GPServer.xml. 

I am posting both, as some had questions on whether i had included the jaxb
namespace correctly. 

I have solved this problem, but i was wondering if this could be done
without modifying the wsdl?



Rahul Ravikumar wrote:
> 
> 
> I understand that one of the ways of solving this problem is to promote
> the "ArrayOfString" to an unbound "xs:string". But one of the restrictions
> of this project, is that i must NOT change the WSDL. Is there any other
> way that i can solve this problem?
> 
> The WSDL is located at: http://geog.tamu.edu/~rahul/XML/GPServer.xml
> 
> 

-- 
View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17495080.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Array Of Unbound Types

Posted by Rahul_Ravikumar <ti...@gmail.com>.
I understand that one of the ways of solving this problem is to promote the
"ArrayOfString" to an unbound "xs:string". But one of the restrictions of
this project, is that i must NOT change the WSDL. Is there any other way
that i can solve this problem?

The WSDL is located at: http://geog.tamu.edu/~rahul/XML/GPServer.xml



dkulp wrote:
> 
> 
> As Benson mentioned, seeing the whole wsdl would be a help.
> 
> What CXF is doing it completely per JAXB specifications.   Thus, it's  
> behavior is "correct".
> 
> The "indexed" jaxb extension changes the way the getter/setter methods  
> are generated on the beans.   Instead of just a "List<..> getFoo()"  
> method, it would generate get(int idx), set(int idx, object o),  
> etc.... methods to allow indexed style behavior.   It would NOT change  
> this situation as the ArrayOfString bean would still be created, just  
> the methods to access the list are changed.
> 
> 
> The "proper" schema way to do this is to promote the maxOccurs  
> unbounded and the type up to the place to where you are referring to  
> the ArrayOfString type.   Seeing the full wsdl would be a big help for  
> this.
> 
> Dan
> 
> 
> 
> On May 23, 2008, at 6:54 PM, Rahul_Ravikumar wrote:
> 
>>
>> I am trying to use CXF which is an implementation of JAX-WS and use  
>> the JAXB
>> framework for binding. I my WDSL i have defined a number of complex  
>> types
>> that are "ArrayOf". For e.g.
>>
>> 
>> 
>> 
>> 
>> 
>> An object for holding a String array. ocumentation>
>> 
>> 
>>  type="xs:string" />
>> 
>> 
>>
>> In Axis 1.4, this "ArrayOfString" type gets mapped to String [].  
>> However
>> when i use CXF it generates an ArrayOfString class that consists of  
>> a member
>> List accessible through getter methods.
>>
>> I would however like to map ArrayOfTypes to Type [] or List. I  
>> read
>> some of the documentation and it was suggested that i use the  roperty
>> collectionType="indexed"/> when defining the complex type. But this  
>> does NOT
>> help. The WSDL2Java still generates a ArrayOfType class.
>>
>> Can someone please help me out?
>> -- 
>> View this message in context:
>> http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
> 
> ---
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17494801.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Array Of Unbound Types

Posted by Daniel Kulp <dk...@apache.org>.
As Benson mentioned, seeing the whole wsdl would be a help.

What CXF is doing it completely per JAXB specifications.   Thus, it's  
behavior is "correct".

The "indexed" jaxb extension changes the way the getter/setter methods  
are generated on the beans.   Instead of just a "List<..> getFoo()"  
method, it would generate get(int idx), set(int idx, object o),  
etc.... methods to allow indexed style behavior.   It would NOT change  
this situation as the ArrayOfString bean would still be created, just  
the methods to access the list are changed.


The "proper" schema way to do this is to promote the maxOccurs  
unbounded and the type up to the place to where you are referring to  
the ArrayOfString type.   Seeing the full wsdl would be a big help for  
this.

Dan



On May 23, 2008, at 6:54 PM, Rahul_Ravikumar wrote:

>
> I am trying to use CXF which is an implementation of JAX-WS and use  
> the JAXB
> framework for binding. I my WDSL i have defined a number of complex  
> types
> that are "ArrayOf<Types>". For e.g.
>
> <xs:complexType name="ArrayOfString">
> <xs:annotation>
> <xs:appinfo>
> <jaxb roperty collectionType="indexed"/>
> </xs:appinfo>
> <xs ocumentation>An object for holding a String array.</xs  
> ocumentation>
> </xs:annotation>
> <xs:sequence>
> <xs:element minOccurs="0" maxOccurs="unbounded" name="String"
> type="xs:string" />
> </xs:sequence>
> </xs:complexType>
>
> In Axis 1.4, this "ArrayOfString" type gets mapped to String [].  
> However
> when i use CXF it generates an ArrayOfString class that consists of  
> a member
> List<String> accessible through getter methods.
>
> I would however like to map ArrayOfTypes to Type [] or List<Type>. I  
> read
> some of the documentation and it was suggested that i use the <jaxb  
> roperty
> collectionType="indexed"/> when defining the complex type. But this  
> does NOT
> help. The WSDL2Java still generates a ArrayOfType class.
>
> Can someone please help me out?
> -- 
> View this message in context: http://www.nabble.com/Array-Of-Unbound-Types-tp17442311p17442311.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog