I did some debugging of the generated stub code and this is what I found out.
When we are using Doc/Lit style, WSDL does not have array wrappers,
WSDl2Java generates stubs without the explicit setter method for Lists. Now,
when a service is invoked, a dynamic proxy is created that creates request
object and calls appropriate service method. This proxy is setting all
parameters correctly except List. I would expect the proxy to do the
following: Create a request object, retrieve the live List instance using
the getter, use the List parameter I have passed to populate this live list
and then send it across the wire. This is not happening, only a NULL list is
sent across. When I added an explicit setter method for the List it was
working properly.

Unless I am missing something here, it looks like a bug in the dynamically
generated proxy. Has anyone else faced this problem? 

- Kannan Rajah



Glen Mazza-2 wrote:
> 
> Am Freitag, den 28.12.2007, 18:49 -0800 schrieb rkannan:
>> I have a simple service method <foo> that takes an Integer array and
>> returns
>> an Integer array. I am using Wrapped Doc/Lit style, with JAX-WS and JAXB.
>> The generated WSDL does not contain any wrapper for the array type (RPC
>> style generates wrapper like IntArray, StringArray but Doc/Lit does not).
> 
> The JAXB artifacts are the same for CXF and Metro, because we use the
> sample JAXB implementation.  The JAX-WS artifacts, however, might be
> slightly different (although I think Metro does the same for what you
> are saying.)  It might be best to create your objects using Metro[1] to
> see if there is a difference.
> 
> [1] http://www.jroller.com/gmazza/entry/using_amazon_web_services_with
> (Step #5)
> 
> Note there is an <jaxws:enableWrapperStyle/> option described in Step #4
> of [1], I think it is presently not working in CXF but does work with
> Metro if that would help you.  (I believe you can use the CXF libraries
> with Metro-generated client stubs/service skeletons.)
> 
> 
>> This is an issue as it will lead to problems in differentiating between
>> null
>> and empty arrays. So how do I get wrappers automatically created for
>> array
>> types in my WSDL while using Doc/Lit style?
>> 
>> I went ahead with this WSDL and generated the stub classes. I found that
>> there is no setter method defined for List types. 
> 
> I think that is by design.  Example 5-4 from the source code download
> from "SOA Using Java Web Services" (Hansen)[2] I think will explain the
> situation to you.
> 
> [2] http://soabook.com/code.html, Look for file:
> /chap05/customjava/etc/schemacompiler_withcomments/SimpleOrder.java and
> see the comments at the very-near-end of the file.
> 
> HTH,
> Glen
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-sending-List-as-parameter-using-Wrapped-Doc-Lit-style-tp14534395p14561206.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to