2011-10-17 174 views
0

我試圖使用CleverElements SOAP API,但我無法讓它正常工作。我老實說從來沒有用過SOAP(但是很多用xml-rpc,rest等),並且認爲它應該是直截了當的。我使用Ruby與savon寶石。我可以通過SOAP調用任何不需要任何參數的函數,但是對於帶參數的函數,SOAP服務不會識別這些參數。CleverElements/Sendcockpit無法識別SOAP API參數

這是我的要求:

<?xml version="1.0" encoding="UTF-8"?> 
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="Sendcockpit/API" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="Sendcockpit/API"> 
    <env:Header> 
    <validate> 
     <userid>32027</userid> 
     <apikey>**************</apikey> 
     <version>1.0</version> 
     <mode>live</mode> 
    </validate> 
    </env:Header> 
    <env:Body> 
    <apiGetListDetails> 
     <listID>72472</listID> 
    </apiGetListDetails> 
    </env:Body> 
</env:Envelope> 

這是WSDL文件:http://api.sendcockpit.com/server.php?wsdl

我思念的東西(也許死的簡單,超級明顯,基本SOAP)的東西?

回答

0

沒關係,顯然我需要一個包裝<ctListRequest>節點。我是savon應用由wsdl文件規定的所有東西的印象...

申請工作:

<?xml version="1.0" encoding="UTF-8"?> 
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="Sendcockpit/API" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="Sendcockpit/API"> 
    <env:Header> 
    <validate> 
     <userid>32027</userid> 
     <apikey>***********</apikey> 
     <version>1.0</version> 
     <mode>live</mode> 
    </validate> 
    </env:Header> 
    <env:Body> 
    <apiGetListDetails> 
     <ctListRequest> 
     <listID>72472</listID> 
     </ctListRequest> 
    </apiGetListDetails> 
    </env:Body> 
</env:Envelope>