我有一個SOAP消息作爲字符串,需要解析它在Java中。我接收包含數據和XML數據內容爲同一的SOAP消息下面的一個單獨的XML部分簽名的XML文件是一個示例SOAP消息(是不是一個有效的XML)1接收:解析SOAP消息作爲字符串
------=_Part_2074_1202079654.1337767440483
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: binary
Content-Id: <[email protected]lan>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/>
<soapenv:Body>
<FileSet xmlns="http://www.mydomain.com">
<FileSetId>SRQ</FileSetId>
<File>
<FileType>SRQACK</FileType>
<FileName>ACK-BSP2-BP2-20120523100300-01.xml</FileName>
<FileContentId>1</FileContentId>
</File>
<File><FileType>SRQSIG</FileType>
<FileName>SIG-BSP2-BP2-20120523100300-01.sig</FileName>
<FileContentId>2</FileContentId>
</File>
</FileSet>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_2074_1202079654.1337767440483
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: binary
Content-Id: 1
<?xml version="1.0" encoding="UTF-8"?>
<!--Handle SRQACK, SRSMUT, SUMMUT BP Postbank version 1.1-->
<Acknowledgements xmlns="http://www.mydomain.com">
<Header>
<BatchId>ACK-BSP2-BP2-20120523100300</BatchId>
<InterfaceId>ACK</InterfaceId>
<Version>02.0</Version>
<SourceSystemId>BSP2</SourceSystemId>
<TargetSystemId>BP2</TargetSystemId>
<CreateDateTime>2012-05-23T10:03:00Z</CreateDateTime>
<MessageCount>4</MessageCount>
</Header>
<Acknowledgement>
<BatchId>SRQ-BP2-BSP2-20120416101400</BatchId>
<AckTimeStamp>2012-05-23T10:03:00Z</AckTimeStamp>
<Result>ERROR</Result>
<ReasonCode>107</ReasonCode>
</Acknowledgement>
<Acknowledgement>
<BatchId>SRQ-BP2-BSP2-20120514140516</BatchId>
<AckTimeStamp>2012-05-23T10:03:00Z</AckTimeStamp>
<Result>OK</Result>
</Acknowledgement>
<Acknowledgement>
<BatchId>SRQ-BP2-BSP1-20120514140511</BatchId>
<AckTimeStamp>2012-05-23T10:03:00Z</AckTimeStamp>
<Result>ERROR</Result>
<ReasonCode>112</ReasonCode>
</Acknowledgement>
<Acknowledgement>
<BatchId>SRQ-BP2-BSP3-20120514140520</BatchId>
<AckTimeStamp>2012-05-23T10:03:00Z</AckTimeStamp>
<Result>ERROR</Result>
<ReasonCode>112</ReasonCode>
</Acknowledgement>
</Acknowledgements>
------=_Part_2074_1202079654.1337767440483
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: binary
Content-Id: 2
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--Handle SRQSIG, SRSSIG, EXCSIG, SUMSIG BSP 2 Biller version 1.2-->
<nl:Signature xmlns:nl="http://www.mydomain.com">
<SignatureValue>lJw2CNdcgEGEychSH/snpMvnXrV91775UANSZGN23n7hQnlIiak8Dqr9pe6FAtLjkZ9UZPip26VTxGVzeCHdsgYwrLt3mTLfX0h6KeRhPCYGd9QLxok1yv0Ua6iNlP0oEPaE4t6wJw/CKfCua4W0Jbnm18Ym5J7U08YB1+rc4Lw=</SignatureValue>
<Fingerprint>166105D2F2F23663F4405B6D84A4F51B48907F77</Fingerprint>
</nl:Signature>
------=_Part_2074_1202079654.1337767440483--
什麼ü想從此做! – Deepak
我想整個SOAP信封,包含數據和包含簽名&指紋作爲單獨的DOM的XML的XML。 –