私は動作するPHPスクリプトを持っており、Pythonで同じものを書く必要がありますが、SOAPpyは若干異なる要求を生成します。サーバーを好きなように修正する方法がわかりません。Python SOAPpyを使用してYahoo Enterprise Web Servicesにアクセスする方法は?
PHPスクリプトによって生成された要求は、次のようになります。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://marketing.ews.yahooapis.com/V4"
>
<SOAP-ENV:Header>
<ns1:username>*****</ns1:username>
<ns1:password>*****</ns1:password>
<ns1:masterAccountID>*****</ns1:masterAccountID>
<ns1:accountID>6674262970</ns1:accountID>
<ns1:license>*****</ns1:license>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:getCampaignsByAccountID>
<ns1:accountID>6674262970</ns1:accountID>
<ns1:includeDeleted>false</ns1:includeDeleted>
</ns1:getCampaignsByAccountID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SOAPPyを使用して同じをしようとしたとき、私はこの要求を取得:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>
<SOAP-ENV:Header>
<username xsi:type="xsd:string">*****</username>
<masterAccountID xsi:type="xsd:string">*****</masterAccountID>
<license xsi:type="xsd:string">*****</license>
<accountID xsi:type="xsd:integer">6674262970</accountID>
<password xsi:type="xsd:string">*****</password>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:getCampaignsByAccountID xmlns:ns1="http://marketing.ews.yahooapis.com/V4">
<includeDeleted xsi:type="xsd:boolean">False</includeDeleted>
<accountID xsi:type="xsd:integer">6674262970</accountID>
</ns1:getCampaignsByAccountID>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
わずかに異なる要求をしかし、私はそれが必要がありますねサーバーからエラーが発生しました:「
ヘッダーに指定されたアカウントIDが、パラメーターで指定されたIDと一致しません。
しかし、それらは一致します!
唯一のことは名前空間の違いですが、私は今何をすべきか分かりません。助けてください。
私は同じ結果を残念ながら同じように文字列として渡そうとしました。しかし、とにかく答えてくれてありがとう:)デッドラインが近づいているので、私は今SOAPpyなしで回避しようとしています。 – Andrey