Use WSIMPORT to generate a proxy in the local, call an example of the WebService service interface

For this interface, I chose the interface for querying the attribution information through my mobile phone number. Check the address of this interface: http://ws.webxml.com.cn/ WebServices/MobileCodeWS.asmx

The first step: find the interface url and understand the several calling methods supported by the interface

Note that there are four access methods: soap, soap12, get,post

Step two: in Use wsimport command to generate proxy locally

Command:

wsimport -s ./ -p com.lkm.wximport http://ws. webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl

-s ./ means that the generated proxy class is placed in the current directory;

-p com.lkm.wximport is to generate The package path stored by the proxy class is defined according to the package path of your project, because these classes are to be put into the project later

Note: The content of the following three warnings here means these three None of the calling methods are supported, that is, the first one is soap

After execution, the proxy class will be generated in the corresponding directory

Step 3: Copy the generated proxy to the src of the project

Part IV : Calling the webservice interface by calling the proxy class

Leave a Comment

Your email address will not be published.