The generated "Client" that you see is just a sample for you to use a base to show how it works. Most people won't even use it. With JAX- WS, all you need is the SEI. Even the Service object is "optional", but handy to have.
By default, it leaves creation of any data objects up to you since you are the one that knows what data to send. However, you can specify "- defaultValues" flag using the extra args stuff to have it generate some random values in there.
Dan On Jun 19, 2008, at 6:43 PM, Anthony Davidson wrote:
I have developed a web service with a JAX-WS based front-end using CXF 2.1. Unfortunately, when I generate the client code using the java2ws maven goal, I am not getting what I expect to. The method in my web service takes a complex object (code below). I would expect that the client code that gets generated would include a proxy object for both my web service and the complex object that the service call takes. However, all I get is one client class that reference my SEI. Is it assumed that I will separately repackage some of the contents of my services .war file into a separate .jar file for use in the client (that .jar file having the SEI and copies of related complex objects)? Or am I doing something wrong? Thanks in advance for any help. -Anthony Here is my SEI: @WebService(name="WorkspaceService") public interface WorkspaceService { @WebMethod(operationName="initializeWorkspace") String[] initializeWorkspace(@WebParam(name="workspaceConnectionInfo") DBConnectionInfo workspace); } Here is the class that my web service method takes: public class DBConnectionInfo { private String server; private String port; private String database; public DBConnectionInfo() { }public DBConnectionInfo(String server, String port, String database){ this.server = server; this.port = port; this.database = database; } public String getServer() { return server; } public String getPort() { return port; } public String getDatabase() { return database; } public void setServer(String server) { this.server = server; } public void setPort(String port) { this.port = port; } public void setDatabase(String database) { this.database = database; } } Here is the client code that gets created: public class WorkspaceServiceClient { public static void main(String[] args) throws Exception { QName serviceName = new QName("http://services.centurylogix.com/","WorkspaceServiceService"); QName portName = new QName("http://services.centurylogix.com/","WorkspaceServicePort"); Service service = Service.create(serviceName); service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, "http://localhost:9090/WorkspaceServicePort"); com.centurylogix.services.WorkspaceService client = service.getPort(portName, com.centurylogix.services.WorkspaceService.class); // Insert code to invoke methods on the client here } }
--- Daniel Kulp [EMAIL PROTECTED] http://www.dankulp.com/blog
