1. The procedure is the same as checking the mobile phone number of your blog.
2. Create a weatheraxis. Java File
The Code is as follows:
Package COM. tools; import Org. apache. axiom. om. omabstractfactory; import Org. apache. axiom. om. omelement; import Org. apache. axiom. om. omfactory; import Org. apache. axiom. om. omnamespace; import Org. apache. axiom. soap. soap11constants; import Org. apache. axis2.constants; import Org. apache. axis2.addressing. endpointreference; import Org. apache. axis2.client. options; import Org. apache. axis2.client. serviceclient; import Org. apache. axis2.transport. HTTP. httpconstants; import Org. apache. axis2.transport. HTTP. httptransportproperties. proxyproperties; import Org. apache. commons. logging. log; import Org. apache. commons. logging. logfactory; public class weatheraxis {Private Static endpointreference targetepr = new endpointreference ("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx"); // Private Static endpointreference targetepr = new endpointreference (// "http: // 210.43.64.106/service. asmx "); Public void getresult () throws exception {serviceclient sender = new serviceclient (); sender. setoptions (buildoptions (); omelement result = sender. sendreceive (buildparam (); system. out. println (result);} Private Static omelement buildparam () {omfactory FAC = omabstractfactory. getomfactory (); omnamespace omns = FAC. createomnamespace ("http://WebXml.com.cn/", ""); // omnamespace omns = FAC. createomnamespace ("http://tempuri.org/", ""); omelement DATA = FAC. createomelement ("getweatherbycityname", omns); // omelement DATA = FAC. createomelement ("xscheckpassword", omns); omelement inner = FAC. createomelement ("thecityname", omns); // omelement inner = FAC. createomelement ("XH", omns); inner. settext ("Jishou"); // omelement inner2 = FAC. createomelement ("XM", omns); // inner. settext ("2008198821"); data. addchild (inner); // data. addchild (inner2); return data;} Private Static options buildoptions () {options Options = new options (); options. setsoapversionuri (soap11constants. soap_envelope_namespace_uri); options. setaction ("http://WebXml.com.cn/getWeatherbyCityName"); // options. setaction ("http: // 210.43.64.106/xscheckpassword"); options. setto (targetepr); // options. if setproperty does not access the Internet through a proxy, this sentence can save // options. setproperty (httpconstants. proxy, buildproxy (); options. settransportinprotocol (constants. transport_http); return options;}/*** when the local machine uses a proxy server to access the Internet, you need to set the proxy * @ return */public static proxyproperties buildproxy () {proxyproperties = new proxyproperties (); proxyproperties. setproxyname ("proxy name"); proxyproperties. setproxyport (8080); Return proxyproperties;} public static void main (string [] ARGs) throws exception {weatheraxis S = new weatheraxis (); S. getresult ();}}
3. Success.