私は、自動取引ボットを作成しています。これは、pythonとsuds soap clientを使用しています。SOAPと持続性
永続的なSOAP呼び出しを使用して速度を向上させることが可能かどうかは疑問でした(RESTfulサービスでのセッションの使用と同様)。
DEBUG:suds.client:sending to (http://api.betdaq.com/v2.0/ReadOnlyService.asmx)
message:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://www.GlobalBettingExchange.com/ExternalAPI/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:None="http://www.GlobalBettingExchange.com/ExternalAPI/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<ns0:ExternalApiHeader xmlns="http://www.GlobalBettingExchange.com/ExternalAPI/" version="2" languageCode="en" username="****" password="****" applicationIdentifier="***"/>
</SOAP-ENV:Header>
<ns1:Body>
<ns0:GetPrices>
<getPricesRequest xmlns="http://www.GlobalBettingExchange.com/ExternalAPI/" NumberForPricesRequired="1" NumberAgainstPricesRequired="1">
<MarketIds>9430420</MarketIds>
</getPricesRequest>
</ns0:GetPrices>
</ns1:Body>
</SOAP-ENV:Envelope>
そして私が得る応答は次のとおりです:
DEBUG:suds.client:headers = {'SOAPAction': u'"http://www.GlobalBettingExchange.com/ExternalAPI/GetPrices"', 'Content-Type': 'text/xml; charset=utf-8'}
DEBUG:suds.client:http succeeded: *long xml here*
あなたは私がすべてのXMLリクエストに自分のユーザー名とパスワードのためのヘッダーを使用見ることができるように。ここで
は私の要求は次のようになります。しかし、私が応答を得るとき、ヘッダーにクッキーはありません。
私は、何とかクッキーを私の要求に挿入することができるのか、または永続性を達成するために類似しているのか疑問に思っていました。 (RESTfulサービスでSessionを使用する場合と同じように)
決して本当に石鹸で遊んだのですが、[こちら](http://stackoverflow.com/questions/21587554/extraction-cookie-from-soap-response-in-suds)+ [pickle](https: /docs.python.org/2/library/pickle.html)? – Arount
あなたが見ることができるように@Arountは、私が次のリクエストに挿入できるクッキーを実際に返しません。 – Marijus