Generate a web service client using eclipse

Source: Internet
Author: User

1. Open eclipse (not my eclipse) and create a new Java project;

 

2. After creating a Java project, create a web service client in the project;

 

 

3. Enter the WSDL address provided by the Web Service server and click Next;

 

 

 

4. Select generate ClientCodeStorage package;

 

 

5. Create a new test class. The class example is as follows:

Import Java. RMI. remoteException; </P> <p> public class test {</P> <p>/** <br/> * call a WebService instance using axis <br/> * @ Param ARGs <br/> */<br/> Public static void main (string [] ARGs) {</P> <p> try {<br/> // change to the corresponding proxy class <br/> queryvalidatorservicesproxy proxy = new queryvalidatorservicesproxy (); <br/> proxy. setendpoint ("WSDL address provided by Web Service"); <br/> // replace it with get the corresponding serice <br/> queryvalidatorservices service = proxy. getqueryvalidatorservices (); <br/> // call the method provided by Web Service <br/> string result = service. querysingle ("id5", "******", "XXXX", "XX, xxxxxx"); </P> <p> system. out. println (result); </P> <p >}catch (RemoteException e) {<br/> E. printstacktrace (); <br/>}</P> <p >}< br/>

Related Article

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.