Advertisement
Guest User

magento xlmrpc test

a guest
Nov 23rd, 2013
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import xmlrpclib
  4. from pprint import pprint
  5.  
  6. username = 'openerp_connect' #the user
  7. pwd = 'secretpass'           #the password of the user
  8. site = "example.com"         # magento site url
  9.  
  10. print 'opening socket'
  11. sock_common = xmlrpclib.ServerProxy('http://%s/index.php/api/xmlrpc' % site)
  12. print 'starting login, obtaining session'
  13. session_id = sock_common.login(username, pwd)
  14. pprint(session_id)
  15. resources = sock_common.resources(session_id)
  16. pprint(resources)
  17. result = sock_common.call(session_id,'store.list',[])
  18. pprint(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement