如何使用Spring Batch解析SOAP响应xml。为 org.springframework.batch.item.xml.StaxEventItemReader 创建bean并将 fragmentRootElementName 参数值作为 XMLData 传递,没有返回任何内容,可能是解组问题。< / p>
SOAP XML
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<WSCorIDSOAPHeader xmlns="http://www.wilytech.com/" CorID="5A35F9B79906411A00156F9B91FFE1EB,1:1,0,0,wl-flor-apvm106|Tomcat|dorms106-1|WebServices|Client|http_//tempuri.org/|submit,2,AgAAAdRIQgAAAAFGAAAAAQAAABFqYXZhLnV0aWwuSGFzaE1hcAAAAAdIQgAAAAJGAAAAAgAAABBqYXZhLmxhbmcuU3RyaW5nABBBcHBNYXBDYWxsZXJUeXBlSEIAAAADRQAAAAIACldlYlNlcnZpY2VIQgAAAARFAAAAAgARQXBwTWFwQ2FsbGVyQWdlbnRIQgAAAAVFAAAAAgAKZG9ybXMxMDYtMUhCAAAABkUAAAACAA9DYWxsZXJUaW1lc3RhbXBIQgAAAAdFAAAAAgANMTQ1NzUwNzQwMDExOUhCAAAACEUAAAACABZBcHBNYXBDYWxsZXJNZXRob2ROYW1lSEIAAAAJRQAAAAIAGmh0dHBfLy90ZW1wdXJpLm9yZy98c3VibWl0SEIAAAAKRQAAAAIAEEFwcE1hcENhbGxlckhvc3RIQgAAAAtFAAAAAgAPd2wtZmxvci1hcHZtMTA2SEIAAAAMRQAAAAIAE0FwcE1hcENhbGxlclByb2Nlc3NIQgAAAA1FAAAAAgAGVG9tY2F0SEIAAAAORQAAAAIAClR4blRyYWNlSWRIQgAAAA9FAAAAAgAjNUEyRDkxRjE5OTA2NDExQTAwMTU2RjlCRTAyOEIwNUM5ODU=" />
<To soap:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://fldcvpswa0806.something.com/RTPTransaction/SubmitTransaction.svc?wsdl</To>
<Action soap:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/ISubmitTransaction/Submit</Action>
</soap:Header>
<soap:Body>
<ns2:Submit xmlns="http://schemas.datacontract.org/2004/07/RTPTransaction" xmlns:ns2="http://tempuri.org/" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/">
<ns2:XMLData>
<Creation>2016-03-09 02:10:00</Creation>
<EndOfDays />
<Transactions>
<Transaction>
<BusinessDate>2016-03-09</BusinessDate>
<Items>
<Item>
<Extended>35.0</Extended>
<Number>480000015523</Number>
<Quantity>1</Quantity>
<Taxes>
<Tax>
<Amount>0.00</Amount>
<Rate>0.000</Rate>
<State>FL</State>
<Type>N</Type>
</Tax>
</Taxes>
<Unit>35.0</Unit>
</Item>
</Items>
<Stamp>2016-03-09 00:00:00</Stamp>
<Store>01006</Store>
</Transaction>
</Transactions>
</ns2:XMLData>
</ns2:Submit>
</soap:Body>
</soap:Envelope>