Axis1.4 webService开发教程——004

2016-08-1815:30:10 1 2,194

输入参数是bean的deploy.wsdd配置

当服务类的输入参数是一个bean对象时,怎样配置deploy.wsdd?

1.编写服务一个bean实体类

public class Person {

private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Person() {
super();
}
public Person(String name, int age) {
super();
this.name = name;
this.age = age;
}

2.编写服务类方法,注意参数是一个person类型的数据对象

public String outputInfo(Person p){
return "姓名:"+p.getName()+",年龄:"+p.getAge();
}

3.配置deploy.wsdd文件

图片12

注意:参数如果是一个bean,就要配置bean的序列化!格式如下:

图片13

只有配置了这个才能在传递数据时正确参入参数!

4.重新生成server-config.wsdd文件!

启动tomcat服务器!

浏览器输入:http://localhost:8080/axisservice/services

图片14

5.点击“languageWS(wsdl)”

图片15

6.Myeclipse 自带wsdl测试工具:

图片16

其他的集合数据在deploy.wsdd中的映射配置!图片17

  • 站长交流QQ群
  • 扫一扫加入热聊
  • weinxin
  • 暂时没有
  • 不要问我
  • weinxin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  1   博主  0

    • 豆, 豆豆 豆, 豆豆 1

      so easy ! 还讲这个,老古董