MyEclipse配置WEBService(二)

二. 创建Web Service-Code-first Strategy

在这部分将用MyEclipse Web Service Wizard并通过使用Code-first Strategy来创建一个HelloWorldService示例.


1. 执行MyEclipse Web Service Wizard,有两种方法来执行MyEclipse Web Service Wizard

方法1.从MyEclipse perspective toolbar中来执行向导

在打开的Web Service Wizard上的workbench上来选择新Web Service按钮

方法2.从workbench menubar执行向导

1. 从workbench menubar选择: File>New>Other>MyEclipse>Web Service


Figure-6: Launching Web Service Wizard


2. 在Page-1选择HelloWorld 工程并选择Create web service from Java bean

3. 选择Next到Page-2


Figure-7: Page-1 of new web service wizard

4. 填写Web Service的名字HelloWorldService

5. 选择Java Source folder或者选择New按钮来新建一个source folder

6. 填写Java package或者通过选择Browse按钮来选择一个已经存在的package.也可以选择New按钮来新建一个Java package

注意:对Service接口和Service执行的类的默认值是基于所填入Web Service名字来产生的.

7. 选择Next来初始化Web Service的创建过程


Figure-8: Page-2 of new web service wizard.

该向导产生了IHelloWorldService Java接口和HelloWorldServiceImpl Java类.并且在services.xml配置文件中创建了一个﹤SERVICE>实体(如图所示),注意到example(String message)方法在接口类中产生,当Web Service部署后作为一个测试操作.


Figure-9: Newly created HelloWorld interface and implementation class
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值