我正在寫一個移動設備和magento之間的通信的Web服務,我使用Magento提供的SOAP webservices,但是,我迷失在用戶身份驗證,我需要進行身份驗證我的系統用戶(不是api用戶)。有什麼線索嗎?Magento SOAP WebService - >用戶登錄
5
A
回答
1
您不能使用SOAP Api來記錄magento中的用戶帳戶,因爲它不支持該功能,您必須以其他方式處理它,也許會覆蓋Mage Customer中名爲AccountController.php的控制器文件。
嘗試添加一個可以使用JSON變量與服務器進行通信的新方法。
-1
不,你不能那樣做。如果您可以通過FTP訪問文件,那麼您可以使用數據庫配置文件的get_file_content,然後從外部源連接到數據庫並執行用戶訪問檢查。
適用於您自己承擔風險。可能它無效。但你可以試試!
1
您可以使用REST API來驗證客戶身份。 http://www.magentocommerce.com/api/rest/introduction.html
這種做法似乎更加方便,因爲您可能會收到一個產品列表與登錄的客戶應用類別規則(比方說,通過客戶羣應用)。 SOAP API不提供此類功能(您只能以管理員用戶身份接收產品列表)。
1
使用此
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
$app = Mage::app('default');
Mage::app();
$user = "[email protected]";
$pass = "admin123";
$session = Mage::getSingleton('customer/session');
Mage::app()->getStore()->setWebsiteId(1);
try
{
$session->login($user, $pass);
$customer = $session->getCustomer();
//echo "valid";
$userID = $session->getCustomer()->getId();
$return_array['customer_id'] = $userID;
$return_array['status'] = 1;
$return_array['message'] = "Login is valid";
echo json_encode($return_array);
} catch(Exception $e) {
$return_array['status']= 0;
$return_array['message']="Login is invalid";
echo json_encode($return_array);
}
相關問題
- 1. Magento SOAP登錄錯誤
- 2. PHP - > SOAP - > Magento Webservice:獲取由Magento設置的Cookie
- 3. Magento用戶使用soap api從Android登錄
- 4. 與Magento的SOAP登錄問題
- 5. 使用mysql登錄表單在android 4.0中調用soap webservice
- 6. Magento客戶無法登錄
- 7. Magento客戶無法登錄
- 8. WebService登錄
- 9. jquery webservice登錄
- 10. Magento客戶登錄從外部magento
- 11. Magento soap API忘記密碼webservice實現
- 12. PHP SOAP和Magento WebService的錯誤
- 13. Magento登錄和用戶視圖
- 14. Magento - 登錄後重定向用戶組
- 15. 通過OpenID登錄用戶到Magento
- 16. 用戶登錄到Magento的編程
- 17. Magento用戶登錄後獲取錯誤
- 18. SOAP webservice
- 19. 即使在用戶登錄後出現Magento jscript登錄窗口
- 20. 使用Django SOAP SOAP webservice
- 21. Rest API或Soap webservice
- 22. iOS登錄到webservice
- 23. magento SOAP API
- 24. SOAP WebService objective-c
- 25. Salesforce Soap API登錄
- 26. Magento的客戶webservice/api
- 27. 日期SOAP webservice
- 28. SOAP WebService ...如何?
- 29. Auth->登錄()總是在用戶
- 30. 如果客戶登錄wordpress,他會自動登錄到magento
如果我理解正確,您想使用「admin」的佔了Web服務進行身份驗證?可能會提供一些幫助:http://www.yireo.com/tutorials/magento/magento-programming/629-connecting-to-magento-with-soap-part-1 – B00MER 2011-05-27 15:41:24
不,這就是我已經做的,我想要從該「管理」帳戶驗證「用戶」帳戶,希望您明白這一點。 – 2011-05-27 23:22:15
在相應的手冊中沒有指出apis的基本差異似乎是一種傳統。 – John 2015-02-20 13:59:52