Get the App
SLTechnology News&Howtos  ›  Development  › 

The method of integrating Axis1.4 in java Project

Shulou Source: shulou.com Published: 2022-05-31 21:48:55 10月03日 Update

This article introduces the relevant knowledge of "the method of integrating Axis1.4 in java project". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Server (project name: server)

1.1.Building Axis1.4 environment

1) download axis1.4 file [Click to download], copy all jar packages of axis-1_4\ lib to server\ WebRoot\ WEB-INF\ lib

2) add the following contents to the server-config.wsdd file under server\ WebRoot\ WEB-INF

3) server\ WebRoot\ WEB-INF\ web.xml add content:

Index.jsp AxisServlet org.apache.axis.transport.http.AxisServlet AxisServlet / services/* index.html index.htm index.jsp default.html default.htm default.jsp

1.2.Writing webservice classes and methods

Package com.sdxjd.webservice;public class Server {public String getName (String name) {return "Hello," + name;}}

1.3.deploy Tomcat, open the browser access address:

Http://localhost:8080/server/services

two。 Client (project name: client)

2.1. Use the wsimport command that comes with jdk to generate the client as follows:

Wsimport-keep-pcom.sdjxd.base http://localhost:8080/server/services/Server.jws?wsdl

Copy the generated java file to the client client\ src path

2.2. Write client classes and methods

Package com.sdjxd.client;import com.sdjxd.base.Server;import com.sdjxd.base.ServerService;public class Client {public static void main (String args []) {Server server = new ServerService () .getServer (); String res = server.getName ("webservice"); System.out.println (res) This is the end of the introduction of "the method of integrating Axis1.4 in java Project". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Method project content client client file integration command more knowledge generation utility achievement next dilemma address actual situation article case Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information Docker Redmi macOS