1
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要求は、次のように
public int ReadXmlDocAsString(@WebParam(name = "password") String password,
@WebParam(name = "doc") com.vincari.hl7.jaxws.xmlDoc<Object> doc){
}
マイXMLDOCクラスは次のとおりです。
<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を使って変換しようとしました。これをどのように文字列に変換できますか?どんな助けでも大歓迎です。