This is completely per JAX-WS/JAXB spec. I was hoping we could do something like adding the XmlElementWrapper annotation onto the parameter like we can for the XmlMimeType and XmlList annotations, but XmlElementWrapper has:
@Retention(RUNTIME) @Target({FIELD, METHOD})
so there isn't really anything we can do about it. :-( Creating the wrapper objects is about the only option.


Dan



On Jun 4, 2008, at 2:53 PM, greenstar wrote:


Consider this example client:

@WebServicetargetNamespace="http://foobar.com";)
public interface Test {

   @WebMethod(operationName = "x")
   public String x(
           @WebParam(name = "values") String[] values);
}

Using JaxWsProxyFactoryBean, the array argument gets marshalled to:

<values>1</values>
<values>2</values>
<values>3</values>

I would like to marshal it like this:

<values>
 <value>1</value>
 <value>2</value>
 <value>3</value>
</values>

This seems like this would make it much easier to determine between an empty array and "not provided" (ie: null) at the other end. When I send an empty array, it gets unmarshalled to a null at the other end because it can't tell
the difference.

I can make a wrapper object and things work fine, but shouldn't the standard
simple case using arrays work in a safer way?  What am I missing?

Thanks
--
View this message in context: 
http://www.nabble.com/Marshalling-arrays%3A-tp17653605p17653605.html
Sent from the cxf-user mailing list archive at Nabble.com.


---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog




Reply via email to