Generate server and client code based on WSDL using axis1.4 's Wsdl2java tool

Source: Internet
Author: User
Tags wsdl


Previous projects used to WebService are our service side to provide WDSL, now the group has issued a unified WDSL. Just take over for a while do not know how to do, online search a lot of information.

Of course Axis's Wsdl2java has a lot of information on the Internet, but I see some netizens say need JDK1.5, let me confused some time (our project is older, use of jdk1.4).

Slowly understand Wsdl2java, just know, oneself before to WebService service is how strange, although now is also a smattering, ^_^.

Test environment:

jdk1.4, axis1.4

1, new Web project WebService

2, import all the jar packages under axis1.4 into Classpath

3, put the known WSDL file under the web-info/of the project (the directory is not random)

4, write a simple batch file Wsdl2java.bat (also can be repeated Dos)

Set Axis_lib=e:/workspace/cattsoft/csm/webservice/webroot/web-inf/lib
Set Java_cmd=java-djava.ext.dirs=%axis _lib% Org.apache.axis.wsdl.WSDL2Java
Set output_path=e:/workspace/cattsoft/csm/cust/src
%java_cmd%-o%o utput_path%--server-side grpacctinfoser.wsdl

Double-click the Wsdl2java.bat file to generate the server and client code

The deployment file is also generated: DEPLOY.WSDD, uninstalling the file: UNDEPLOY.WSDD

5, find the Web.xml in the Web.xml overlay project from the downloaded axis1.4 jar package, which is equivalent to configuring the access servlet

6, deploy the project and start the server. Copy the DEPLOY.WSDD to the web-info of the deployment path and generate SERVER-CONFIG.WSDD files using the org.apache.axis.client.AdminClient command

CMD to DEPLOY.WSDD location:

JAVA-CP%axis_classpath% Org.apache.axis.client.adminclient-lhttp://localhost:8080/test/services/myserver Deploy.wsdd

Axis_classpath: Class path configured in environment variable, pointing to all jar packages under axis

After the SERVER-CONFIG.WSDD file is generated, access:

Http://localhost:7001/servlet/AxisServlet

will be realistic list of services.

Note: I then did this step when accessing the WSDL times incorrectly:

Fault-maketypeelement () is told to create a type "{Http://ws.chinaunicom.cn/GrpAcctInfoSer/un Ibssbody/syncgrpaccountinforeq}>>cust_infos>cust_info ", with no containing element

Bothered me for a long time, or Google to force, seems to be axis of a bug, although the browser can not access the WSDL, but client access is normal.

Solution Connection:

Http://www.coderanch.com/t/222942/Web-Services/java/Developing-Web-Services-Apache-Axis



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.