first, the release of WebService servicesmethod One: Generate the WSDL file on the server side, directly under the client reference can be Pros: Generate a WSDL file for the method you want to publish without unnecessary configuration. Cons: Each service-side method change requires a rebuild of the corresponding WSDL file, which is not suitable for methods that require frequent changes in functionality. Way Two:
second, client Call Server interface 1, the project structure is as follows: 2. Call Process:1) Right click on the project name---"NEW"--"other"--Enter the Web service client as follows 2) Complete the Client Configuration window that appears as follows 3) Enter WebService Open service address in "service definition", note that the address must be added at the end of the "? WSDL " It is also important to note that the Web service client that you create must be the following version 3.0. 4) Except for the Testclient.java class, this project is created by itself, and the others are automatically generated. 5) Testclient.java classPublic static void Main (string[] args) {try {helloworldserviceservicelocator service = new Helloworldserviceservicelocator ();Java.net.URL URL = new Java.net.URL ("Http://localhost:8080/mywebservices/services/HelloWorldService.jws?W SDL ");helloworldservicesoapbindingstub stub = new Helloworldservicesoapbindingstub (URL, service);String x2 = stub.getmessage ();System.out.println (x2); } catch (RemoteException e) {//TODO auto-generated catch Block20e.printstacktrace ();} catch (Malformedurlexception e) {//TODO auto-generated catch block23e.printstacktrace (); } } The main use here is ***locator and ***stub these two classes.
WebService client dynamic Invoke service-side function method