我有一个 SOAP 消息作为字符串,需要用 Java 解析它。我收到一个 XML 文件,其中包含数据和 XML 数据内容的签名,作为同一条肥皂消息的单独 XML 部分以下是我收到的示例 SOAP 消息(不是有效的 xml):
------=_Part_2074_1202079654.1337767440483
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: binary
Content-Id: <164914372224.1337767440483.IBM.WEBSERVICES@su79aas2.pinkroccade.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--