users@glassfish.java.net

Web Service Error because of _at_ResponseWrapper in Glassfish

From: <glassfish_at_javadesktop.org>
Date: Tue, 25 May 2010 08:08:54 PDT

Hi all,

I would like to consume a web service inside a glassfish application. My Web Service has this function:

        @WebMethod(action = "findCustomer", operationName = "findCustomer")
        @ResponseWrapper(className = "a.b.c.response.CustomerList")
        public @WebResult(name = "customerList")
        List<KundenAlphaSuche> findCustomer(String name);

I have the @ResponseWrapper annotation because I want to return empty lists instead of null. Here is the implementation of the CustomerList class:

        @XmlType(name = "CustomerList")
        public class CustomerList {

                @XmlElementWrapper(nillable = false, name = "return")
                @XmlElement(name = "CustomerList")
                public List<Customer> customerList;
        }
        
When I call the Web Service with the jax ws implementation from the jdk everything works fine. But when I call it from inside the glassfish application I get the following error:
        
        
SCHWERWIEGEND: javax.xml.ws.WebServiceException: class a.b.c.response.CustomerList do not have a property of the name customerList
at com.sun.xml.ws.client.sei.ResponseBuilder$DocLit.<init>(ResponseBuilder.java:533)
        at com.sun.xml.ws.client.sei.SEIMethodHandler.buildResponseBuilder(SEIMethodHandler.java:172)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.<init>(SyncMethodHandler.java:85)
        at com.sun.xml.ws.client.sei.SEIStub.initMethodHandlers(SEIStub.java:94)
        at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:84)
        at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:602)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:326)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:364)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:368)
        at javax.xml.ws.Service.getPort(Service.java:168)
caused by: javax.xml.bind.JAXBException: customerList is not a valid property on class a.b.c.response.CustomerList


If I remove the @ResponseWrapper annotation from my WebService, the error disapears. But I can not change the behaviour of the service. Is this a bug in the glassfish implementation? Any hints?

Thank you very much,
Marc
[Message sent by forum member 'mabaumga']

http://forums.java.net/jive/thread.jspa?messageID=471368