Java calls the webservice interface through axis2

Install axis2

Download axis2-1.7.9 and add environment variables locally
- Download address: https://download.csdn.net/download/qq243348167/86745080
Add environment variables
Variable name: AXIS2_HOME
Variable value: D:\Program Files\ axis2-1.7.9
Path added: %AXIS2_HOME%\bin

parse webservice

Use commands to parse webservice into code

wsdl2java -uri http://127.0.01/SMS_Webs.asmx?wsdl -p com.brickdog.webservice -o d:\wsdl2java

Parameter Description

-o: Specify the output path of the generated code
-a: Generate asynchronous mode code 
-s: Generate synchronous mode code 
-p: Specify the package name of the code 
-l: The language used (Java/C) The default is java
-t: Generate test cases for the code
-ss: Generate server code, not generated by default
-sd: Generate service description file services.xml, only used with -ss 
-d: Specify databingding, for example, adb, xmlbean, jibx, jaxme and jaxbri 
- g: Generate server and client code 
-pn: When there are multiple ports in the WSDL, specify one of the ports 
-sn: Select a service in the WSDL
-u: Expand the data-binding class
-r: Specify for code generation A repository
-ssi: Implement code generation interface class for the server 
-S: Specify the storage path for the generated source code 
-R: Specify the storage path for the generated resources 
--noBuildXML: Do not generate the build.xml file in the output 
--noWSDL: Output WSDL is not generated in

Call webservice

Copy the parsed code into your own project

 

 

 You can call it directly in the project

 

Guess you like

Origin blog.csdn.net/qq243348167/article/details/127243712