Eclipse: How to debug the Web Service of weather forecast.

Source: Internet
Author: User

For more information about JDK installation and configuration, see other articles.

Step 01: select the latest eclipse version.

 

 

Step 02:

Get the URL of the corresponding WSDL released by Shanghai thinking set:

Http://www.webxml.com.cn/WebServices/WeatherWebService.asmx? WSDL

 

Step 03: file -- New -- Other

Select Web serviceclient

 

Click Next]

 

Click Browse and enter the WSDL

 

Click Finish to generate the following file directory:

 

Step 04 create test. Java

Enter the following code to test.

PackageWeathertest;

 

ImportJava. RMI. RemoteException;

 

ImportJavax. xml. rpc. serviceexception;

 

ImportCn.com. webxml. weatherwebservicelocator;

ImportCn.com. webxml. weatherwebservicesoap;

 

Public classWeathertest {

 

/**

*@ ParamARGs

*/

Public static voidMain (string [] ARGs ){

//TodoAuto-generated method stub

Stringthecityname = "Dezhou ";

Weatherwebservicesoap wwsopat;

Java. Lang. String [] city =Null;

Weatherwebservicelocatordmslocator =NewWeatherwebservicelocator ();

System.Out. Print ("test100000000000000000000000 \ n ");

Try{

Wwsopat = dmslocator. getweatherwebservicesoap ();

City = wwsopat. getweatherbycityname (thecityname );

}Catch(Serviceexception e ){

//TodoAuto-generated Catch Block

E. printstacktrace ();

}Catch(RemoteException e ){

//TodoAuto-generated Catch Block

E. printstacktrace ();

}

System.Out. Print ("test11111111111111111111111111 \ n ");

System.Out. Print ("Desc:" + city. tostring () + "\ n ");

}

}

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.