简体   繁体   English

如何将Axis2示例项目导入eclipse?

[英]How to import an Axis2 sample project into eclipse?

How to import an Apache Axis2 sample project into eclipse ? 如何将Apache Axis2示例项目导入eclipse? I tried to import the project named pojo, but no success.. What folder to import??? 我试图导入名为pojo的项目,但没有成功。 It seems that normal importing method doesn't work here. 似乎正常的导入方法在这里不起作用。

Create a new dynamic web project in Eclipse (You need to have Eclipse J2EE version) 在Eclipse中创建一个新的动态Web项目(您需要具有Eclipse J2EE版本)

创建新的动态Web项目

Copy the sample pojo source code from the AXIS2_HOME\\sample directory to the dynamic web project source code directory 将示例pojo源代码从AXIS2_HOME \\ sample目录复制到动态Web项目源代码目录

AXIS2_HOME \\样本\\ POJO

将POJO源复制到动态Web源

Create a new Webservice from Eclipse 从Eclipse创建新的Web服务

在此处输入图片说明

Select Bottom Up and Select the AddressBookService in the package sample.addressbook.service 选择“自下而上”,然后在包sample.addressbook.service中选择AddressBookService。

Make sure you select Axis, and the Project name. 确保选择“轴”和“项目名称”。 Also check the Client options as below, 还要检查如下的“客户端”选项,

在此处输入图片说明

Click Finish 点击完成

在此处输入图片说明

Move the client code to the client project PojoClient (AddressBookADBClient in package sample.addressbook.adbclient 将客户端代码移动到客户端项目PojoClient(包sample.addressbook.adbclient中的AddressBookADBClient

在此处输入图片说明

Refactor the package name and methods to fit the stub automatically generated 重构软件包名称和方法以适合自动生成的存根

I have made 3 changes Modified the package name to match the stubs 我进行了3次更改修改了程序包名称以匹配存根

1) //import sample.addressbook.stub.AddressBookServiceStub;
import sample.addressbook.service.AddressBookServiceStub;

Modified the method name to match the stubs 修改了方法名称以匹配存根

2)//addEntry.setArgs0(entry);
   addEntry.setEntry(entry);

Modified the method name to match the stubs 修改了方法名称以匹配存根

3) //findEntry.setArgs0("Abby Cadabby");
    findEntry.setName("Abby Cadabby");

在此处输入图片说明

One final change in the service, since i was not able to get the test it. 服务的最后一项更改,因为我无法进行测试。 I made the entries variable to static 我将条目变量设置为静态
private static HashMap entries = new HashMap(); 私有静态HashMap条目= new HashMap();

在此处输入图片说明

All Set response from SOAP UI 来自SOAP UI的全部设置响应

在此处输入图片说明

在此处输入图片说明

Response from Client Java Code 客户端Java代码的响应

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM