【发布时间】:2017-07-21 11:15:39
【问题描述】:
我有一个服务方法,它有一个带有 2 个参数的方法:
public int ReadXmlDocAsString(@WebParam(name = "password") String password,
@WebParam(name = "doc") com.vincari.hl7.jaxws.xmlDoc<Object> doc){
}
我的xmlDoc类如下:
public class xmlDoc<T> {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<T> content;
public List<T> getContent() {
if (content == null) {
content = new ArrayList<T>();
}
return this.content;
}
public void setContent() {
content = this.content;
}
}
我的示例肥皂请求是:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sample="http://sample.vincari.com/">
<soap:Header/>
<soap:Body>
<sample:ReadXmlDocAsString>
<!--Optional:-->
<password>1234</password>
<!--Zero or more repetitions:-->
<doc>
<Header Application="SourceApp">
<CustomerData>
<Customer AccountNumber="1234" customername="ABCD">
</Customer>
<CustomerData>
</Header>
</doc>
</sample:InsertPatientInfoImpl>
</soap:Body>
</soap:Envelope>
我能够使用 cxf 部署 web 服务。但是当我尝试映射 doc 对象并尝试将其作为字符串获取时。我使用 toString 并尝试使用 DOMSource 进行转换。如何将其转换为字符串。非常感谢任何帮助。
【问题讨论】:
标签: java web-services jaxb cxf marshalling