I am new to web services and glassfish. Here is my code
package ws.mypkg;
import java.util.ArrayList;
import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style=Style.RPC)
public class TestRPC {
// This seems to cause the problem when a List is returned.
public List<String> testRPC () {
List<String> l = new ArrayList<String>();
l.add("Hello");
return l;
}
// This method work fine
public String testRPC1 () {
return "Testing RPC";
}
}
If I have
@SOAPBinding(style=Style.RPC)
I get the following error when I try to deploy the web service.
cannot Deploy TestGF deploy is failing=Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: Servlet web service endpoint '' failure. Please see server.log for more details.
Server log does not have anything more.
It deploys fine when I comment out @SOAPBinding(style=Style.RPC)
The problem appears to be with the first method. If I exclude the first method, the second method deploys fine. It seems like I am having this problem when I return a list from the method and I have @SOAPBinding(style=Style.RPC)
I am using Glassfish 4.0, jdk 1.7 and Eclipse (bundled in with Spring 3.4)