Guest User

Untitled

a guest
Nov 19th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. import xmlrpc.client
  2. import customer
  3. import magento
  4.  
  5. client = None
  6. session = None
  7. user = 'user'
  8. password = 'password'
  9.  
  10.  
  11. def setup():
  12. global client, session
  13. client=xmlrpc.client.ServerProxy("domain")
  14.  
  15. session = client.login(user, password)
  16.  
  17.  
  18. setup()
  19.  
  20. attribute_sets = client.call(session, customer.Customer.list)
  21. print(attribute_sets)
  22.  
  23.  
  24. attributes = client.call(session, customer.Customer.list, [attribute_sets[0]['set_id']])
  25. print(attributes)
  26.  
  27. Traceback (most recent call last):
  28. File
  29. "/home/sunarcindeni/PycharmProjects/product_rating/magentoAPI.py",
  30. line 19, in <module>
  31. setup()
  32. File "/home/sunarcindeni/PycharmProjects/product_rating/magentoAPI.py",
  33. line 15, in setup
  34. session = client.login(user, password)
  35. File "/usr/lib/python3.5/xmlrpc/client.py", line 1092, in __call__
  36. return self.__send(self.__name, args)
  37. File "/usr/lib/python3.5/xmlrpc/client.py", line 1432, in __request
  38. verbose=self.__verbose
  39. File "/usr/lib/python3.5/xmlrpc/client.py", line 1134, in request
  40. return self.single_request(host, handler, request_body, verbose)
  41. File "/usr/lib/python3.5/xmlrpc/client.py", line 1167, in single_request
  42. dict(resp.getheaders())
  43. xmlrpc.client.ProtocolError: <ProtocolError for "example.com" 302 Found>
Add Comment
Please, Sign In to add comment