私は 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"><?xml version="1.0" encoding="UTF-8"?>\n<operationResult version="2.0.1">\n\t<returnCode><![CDATA[0]]></returnCode>\n</operationResult>\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.
応答の最初に、しかしそれだけが入ってきます。