WebService client dynamic Invoke service-side function method

Source: Internet
Author: User
Tags wsdl

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.