一次WebService调试的遗留问题
在上一篇《一次WebService调试》里,简单的完成了WebService的开发与调用,但还存在着两个问题:
1.客户端生成的代码里,RemoteUser这个对象,每个属性并不是预想中的String,而是javax.xml.bind.JAXBElement<String>。
这个问题可以使用aegis来处理,在RemoteUser所在的包下添加一个RemoteUser.aegis.xml文件,如下:
<?xml version="1.0" encoding="UTF-8"?>
<mappings xmlns:tns="http://www.xxx.com/services/nopService”>
<mapping name="tns:RemoteUser">
<property minOccurs="1" maxOccurs="1" nillable="true" name="fax" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="mail" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="mobile" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="name" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="post" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="pwd" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="sex" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="telephone" />
<property minOccurs="1" maxOccurs="1" nillable="true" name="uid" />
</mapping>
</mappings>
2.客户端生成的代码里,getAccount()的返回值GetAccountResponse里的并不是预想中的List<RemoteUser>,而是一个ArrayOfRemoteUser对象中再包了一个类型为List<RemoteUser>的属性。
现在这个问题还没有解决。。。。。。