cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mickael Istria <mickael.ist...@openwide.fr>
Subject Re: net.java.dev.jaxb.array.StringArray[] versus String[][]
Date Wed, 10 Dec 2008 10:26:51 GMT
Hi Benson, hi all,

Indeed, you are right.
I was using a ServerFactoryBean, but since I annotated my classes with 
Jax-Ws annotations, CXF handled it as a jax-ws service with jaxb types.
Then I keeped my jax-ws annotations and use explicitly a 
JaxWsServerFactoryBean and a JaxWsClientFactoryBean (actually, I did not 
really need a DynamicClientFactory in my test).
And everything is now OK, databinding between jaxb xml types and Java 
types is ok.

Thank you for your help.

Regards
Mickael


Benson Margulies a écrit :
> This is mandated by the JAXB 2.1 spec, as follows:
>
> 8.12.7Multidimensional Array
> By default, a multidimensional array must be mapped to a complex type as
> follows. Note the table specifies a two dimensional array mapping. If
> an array is
> more than two dimensions, then the mapping is used recursively.
> Table 8-1 Mapping: Two dimensional array to Complex Type Definition
> {name} If the basetype is a primitive type (e.g. int[][]) or its
> corresponding wrapper class (e.g. Integer[][]), then the
> name is basetype concatenated with "Array" (e.g.
> intArray).
> otherwise if the basetype is a reference type (e.g.
> Foo[][]), then the XML name to which the reference
> type is mapped (e.g. foo) concatenated with "Array"
> (e.g. fooArray).
> {target namespace} if the basetype is a primitive or its corresponding
> wrapper class then "http://jaxb.dev.java.net/
> array"
> otherwise the namespace to which the reference type is
> mapped (e.g. for Foo[][], the namespace of the XML
> type to which Foo is mapped).
> {base type definition} xs:anyType
> {derivation method} restriction
> {final} #all
> Notes
> 12/11/06 JAXB 2.1 – Final Release 293
> 8.13Notes
> This section contains a collection of notes intended to aid in the
> review of this
> version of the specification. They are collected here in a separate section and
> referenced from possibly multiple places elsewhere in the specification to make
> the specification more compact.
> {abstract} false
> {attribute uses} empty set
> {attribute wildcard} absent
> {content type} element-only content
> content model mapped as specified in
> Table 8-36, "Mapping: Two dimensional array to
> sequence model group," on page 292".
> {prohibited
> substitutions}
> Empty set
> {annotations} absent
> Table 8-2 Mapping: Two dimensional array to sequence model group
> {compositor} xs:sequence
> {particles} A repeating element defined as follows:
> <xs:element name="item"
> type=schematype minOccurs="0"
> maxOccurs="unbounded"
> nillable="true"/>
> where schematype is the schema to which the array's
> component type is mapped (e.g. int[][], then "xs:int";
> Foo[][] then "foo" assuming Foo is mapped to the
> schema type foo.
> {annotation} unspecified
>
> On Tue, Dec 9, 2008 at 7:55 PM, Benson Margulies <bimargulies@gmail.com> wrote:
>   
>> I'm relatively sure that this happens because you are hitting a
>> requirement of the JAX-WS spec.
>>
>> This leads me to believe that you are not using ServerFactoryBean, but
>> rather JaxWsServerFactoryBean.
>>
>> Are you sure? There might be a reason why we feel compelled to do like
>> JAX-WS even in this case, but I wanted to check.
>>
>>
>> On Tue, Dec 9, 2008 at 10:42 AM, Mickael Istria
>> <mickael.istria@openwide.fr> wrote:
>>     
>>> Hello,
>>>
>>> First of all, I'd like to apologize in case of this question is a classic
>>> about CXF and/or JaxB, but my research did not give me a good answer, that's
>>> why I come to this mailing-list.
>>>
>>> I have a Service that I expose from a Java class with a "normal" CXF
>>> ServerFactoryBean with default databinding and co... (I attached the WSDL
>>> generated by CXF).
>>> The only method in my class is
>>> public String[][] TestJob() throws Exception
>>>
>>> I now access this service in a JUnit test with a DynamicClientFactory. But
>>> the result of client.invoke("TestJob") is actually a
>>> net.java.dev.jaxb.array.StringArray[]  whereas I wish to have a String[][].
>>>
>>> I imagine that there is a way to get the String[][] I expect, and I also
>>> imagine (according to the wsdl that contains the StringArray type
>>> definition) that such a customization may occur at server side, but I did
>>> not succeed to find how to specify it.
>>>
>>> Does anyone have a clue to help me?
>>>
>>> Regards,
>>> Mickael
>>>
>>>       


Mime
View raw message