[jboss-user] [JBossWS] - Re: Problems returning arrays from Webservice Method

kaza do-not-reply at jboss.com
Fri Oct 27 02:56:50 EDT 2006


Sorry Jason, but I don't know exactly what you mean by "jira issue" but here is my server code and a snippet of a junit test that tries to access this (I simplified things  a bit to focus on the problem)

First of all my ServiceWS class

public class ServiceWS {
    private Long id;
    private String name;

    public Long getId(){ return this.id;}
    public void setId(Long id) {this.id = id;}
    public String getName(){return this.name;};
    public void setName(String name){this.name=name;}
}

Then there is the ServiceWSArray class

public class ServiceWSArray {
    private ServiceWS[] value;
    
    public ServiceWSArray() {
    }

    public ServiceWS[] getValue() {
        return this.value;
    }

    public void setValue(ServiceWS[] value) {
        this.value = value;
    }
}

And finally there is my webservice endpoint

@Stateless
@WebService(serviceName="MyWebService") 
    @SOAPBinding(style=Style.RPC,use=Use.LITERAL)
    public class FacadeWS {

        @WebMethod public ServiceWSArray getServiceInfos() 
            throws UnknownServiceProviderException {
            
            if (this.logger.isTraceEnabled())
                this.logger.trace("SOAP:getServiceInfos");
            
            ServiceWS[] services = new ServiceWS[10];
            for (int i=0;i<10;i++)
                services = new ServiceWS.fromService();
            
            ServiceWSArray result = new ServiceWSArray();
            result.setValue(services);
            
            return result;
        }
}


On the junit client I create the port to this service and just call this 

       this.getPort().getServiceInfos();


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981234#3981234

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981234



More information about the jboss-user mailing list