ich eine Service-Methode haben, die ein Verfahren mit 2 params hat:jaxb Unmarshalling ein XML-Dokument anytype
public int ReadXmlDocAsString(@WebParam(name = "password") String password,
@WebParam(name = "doc") com.vincari.hl7.jaxws.xmlDoc<Object> doc){
}
Meine xmlDoc Klasse ist wie folgt:
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;
}
}
und meine Probe Seife Anfrage ist:
<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>
Ich bin in der Lage, den Webservice mit CXF bereitzustellen. Aber wenn ich versuche, das doc-Objekt zuzuordnen und zu versuchen, es als String zu bekommen. Ich habe ToString verwendet und versucht, auch mit DOMSource zu transformieren. Wie kann ich dies in eine Zeichenkette umwandeln? Jede Hilfe wird sehr geschätzt.