I’m trying to make some requests on the eBay’s webservice using python’s suds, but I always get this error:
“Missing SOA operation name header”
The code I use is as follows:
client = Client(EBAY_WSDL)
ns1 = ('ns1', 'http://www.ebay.com/marketplace/search/v1/services')
operation_name = Element('X-EBAY-SOA-OPERATION-NAME',ns=ns1).setText('findItemsByKeywords')
appid = Element('X-EBAY-SOA-SECURITY-APPNAME',ns=ns1).setText('MY APP ID')
headers = [appid,operation_name]
client.set_options(soapheaders=headers)
I can’t see what I’m doing wrong with the headers… can someone point it out for me?
Thanks!
–EDIT–
Well, for anyone with the same problem.
I’ve solved this issue.
The problem is that I’m setting soap header when it should be the http header.
So, the answer is put the headers in the Client constructor, like this:
operation_name = {'X-EBAY-SOA-OPERATION-NAME':'findItemsByKeywords', 'SomeOther':'blabla'}
client = Client(EBAY_WSDL,headers=operation_name)
That’s it!
Copying answer from original poster: brunodea
Well, for anyone with the same problem.
I’ve solved this issue.
The problem is that I’m setting soap header when it should be the http header.
So, the answer is put the headers in the Client constructor, like this:
That’s it!