1

私は Python と Suds を使用して SOAP Web サービスを使用していますが、応答データが大きすぎると、応答形式が に切り替わることがありますWS-Attachment。これは完全な MIME メッセージであるはずですが、代わりに、次のような「境界」部分のみを取得します。

------=_Part_2_27050467.1235668849951
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <0F082AF1DAF83B3077B1867B4FC8AAA6>

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
    <ns1:runReportResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://axis2.ws.jasperserver.jaspersoft.com">
        <runReportReturn xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;operationResult version=&quot;2.0.1&quot;&gt;\n\t&lt;returnCode&gt;&lt;![CDATA[0]]&gt;&lt;/returnCode&gt;\n&lt;/operationResult&gt;\n
        </runReportReturn>
    </ns1:runReportResponse>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_2_27050467.1235668849951
Content-Type: application/pdf
Content-Transfer-Encoding: binary
Content-Id: <report>

%PDF-1.4\n%âãÏÓ\n1 0 obj <</Filter/FlateDecode/Length 29>>stream\nx+är\ná26S°00S\bIár\rá\näâ

応答の両方の部分を適切に抽出する方法は? Python の電子メール モジュール クラスはどれも、このデータをうまく処理できません。それらはすべて、1 つの大きな文字列であると想定しています。私は次のようなものを期待していました:

MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=_Part_2_27050467.1235668849951; type=text/xml;
        start="<some@domain.com>"
Content-Description: This is the optional message description.

応答の最初に、しかしそれだけが入ってきます。

4

0 に答える 0