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).
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. As a result, the Integer
list that I send as parameter is not getting sent across the wire. I
verified this from the SOAP message request. When I added a setter method
manually to the stub class this problem got fixed. The stub class has a
comment that says that the accessor method returns a reference to live list
and hence there is no explicit setter method, but this works only when there
is a wrapper created for the List. 

I am not sure if this is a known bug with CXF or I am missing something
fundamental. I am blocked on this for a day now. To avoid ambiguity, I am
giving the code snippet of SEI and implementation class with annotations. 

******************************************************
@WebService(name = "CompanyServiceImplPortType")
@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)
public interface CompanyService {       
        public Integer[] foo(@WebParam(name = "ids") Integer[] ids);
}
******************************************************
@WebService(endpointInterface = "CompanyService")
public class CompanyServiceImpl {
    public Integer[] foo(Integer[] ids) {
http://www.nabble.com/file/p14534395/Nabble.zip Nabble.zip 
        // Do something with ids.         -----> Problem here: ids is always
null
        return new Integer[] {new Integer(200), new Integer(2000)};
    }
}
******************************************************

For ease of understanding, I am attaching the WSDL and the generated stub
classes.
CompanyServiceImplPortType.java is the service interface stub class
Foo.java is the request stub class
FooResponse.java is the response stub class


Thanks,
Kannan Rajah http://www.nabble.com/file/p14534395/Nabble.zip Nabble.zip 
-- 
View this message in context: 
http://www.nabble.com/Problem-sending-List-as-parameter-using-Wrapped-Doc-Lit-style-tp14534395p14534395.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to