我嘗試使用savon-gem通過SOAP登錄Affili.net。SOAP Ruby On Rails登錄Affili.net
client = Savon.client do
wsdl "https://api.affili.net/V2.0/Logon.svc?wsdl"
end
message = {
'Username' => '123123',
'Password' => '123123',
'ins2:WebServiceType' => 'Publisher' }
response = client.call(:logon, :message => message)
但我只得到此異常:
(a:DeserializationFailed) The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://affilinet.framework.webservices/Svc:LogonRequestMsg. The InnerException message was 'Error in line 1 position 777. 'EndElement' 'LogonRequestMsg' from namespace 'http://affilinet.framework.webservices/Svc' is not expected. Expecting element 'Username | Password | WebServiceType'.'. Please see InnerException for more details.
https://developer-api.affili.net/V2.0/Logon.svc?wsdl
的哪些錯誤?
更新
現在,我嘗試了一些工具,像這樣:
而且還告訴我:這是行不通的。但我的帳戶和憑據都可以!
所以我試圖在PHP
define ("WSDL_LOGON", "https://api.affili.net/V2.0/Logon.svc?wsdl");
define ("WSDL_STATS", "https://api.affili.net/V2.0/PublisherStatistics.svc?wsdl");
$Username = '123123'; // the publisher ID
$Password = '123123'; // the publisher web services password
$SOAP_LOGON = new SoapClient(WSDL_LOGON);
$Token = $SOAP_LOGON->Logon(array(
'Username' => $Username,
'Password' => $Password,
'WebServiceType' => 'Publisher'
));
echo $Token;
和它的作品!
所有在線工具,所有離線工具和Ruby on Rails和PHP有什麼區別?
不會改變任何東西 – Paket2001 2014-09-24 14:22:53
@ Paket2001如果添加命名空間'logon'或'logon_request'(更新我的答案) – itsnikolay 2014-09-24 14:29:16
這是一個好主意嘗試它象徵,但它不起作用。 WSDL告訴我可以像我一樣嘗試使用msg。 – Paket2001 2014-09-26 09:33:37