开发者

Error importing adsense api v3 wsdl with python-suds

This script

from suds.client import Client
server = "https://sandbox.google.com"
client = Client(server + "/api/adsense/v3/AccountService?wsdl")
print client

doesn't work with AdSense API v3:

$ ./v3_bug.py
Traceback (most recent call last):
  File "./v3_bug.py", line 4, in <module>
    client = Client(server + "/api/adsense/v3/AccountService?wsdl")
  File "/usr/lib/python2.6/dist-packages/suds/client.py", line 112, in __init__
    self.wsdl = reader.open(url)
  File "/usr/lib/python2.6/dist-packages/suds/reader.py", line 152, in open
    d = self.fn(url, self.options)
  File "/usr/lib/python2.6/dist-packages/suds/wsdl.py", line 159, in __init__
    self.build_schema()
  File "/usr/lib/python2.6/dist-packages/suds/wsdl.py", line 220, in build_schema
    self.schema = container.load(self.options)
  File "/usr/lib/python2.6/dist-packages/suds/xsd/schema.py", line 95, in load
    child.dereference()
  File "/usr/lib/python2.6/dist-packages/suds/xsd/schema.py", line 323, in dereference
    midx, 开发者_如何学运维deps = x.dependencies()
  File "/usr/lib/python2.6/dist-packages/suds/xsd/sxbasic.py", line 469, in dependencies
    raise TypeNotFound(self.ref)
suds.TypeNotFound: Type not found: '(Exception, http://www.w3.org/2001/XMLSchema, )'

If I change v3 to v2, everything works fine:

$ ./v3_bug.py 

Suds ( https://fedorahosted.org/suds/ )  version: 0.4 GA  build: R699-20100913

Service ( AccountServiceService ) tns="http://www.google.com/api/adsense/v2"
   Prefixes (1)
      ns0 = "http://www.google.com/api/adsense/v2"
   Ports (1):
      (AccountService)
         Methods (16):
            addSyndicationService(SyndicationService_Type synServiceType, )
...

I know about doctors, but I don't know where the error is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜