python – 有没有人能够使用肥皂肥皂库来使用NetSuite WSDL?

有没有人能够使用肥皂肥皂库来使用NetSuite WSDL?我尝试创建客户端时收到此错误.

from suds.client import Client

#url = 'http://mssoapinterop.org/asmx/simple.asmx?WSDL'
url = 'https://webservices.netsuite.com/wsdl/v2009_2_0/netsuite.wsdl'
client = Client(url)
print client


Traceback (most recent call last):
client = Client(url)
File "build\bdist.win32\egg\suds\client.py", line 112, in __init__
File "build\bdist.win32\egg\suds\reader.py", line 152, in open
File "build\bdist.win32\egg\suds\wsdl.py", line 158, in __init__
File "build\bdist.win32\egg\suds\wsdl.py", line 207, in resolve
File "build\bdist.win32\egg\suds\wsdl.py", line 662, in resolve
File "build\bdist.win32\egg\suds\wsdl.py", line 757, in resolvefaults
Exception: fault 'ExceededRecordCountFault' not defined in portType 'NetSuitePortType'

最佳答案 是的,suds可以连接到NetSuite,但是处理WSDL需要很长时间.

这是一些示例代码:

# Open NetSuite Session
wsdlNetSuite = 'https://webservices.netsuite.com/wsdl/v2010_1_0/netsuite.wsdl'
client = Client(wsdlNetSuite)

# Login
passport = client.factory.create('ns4:Passport')
passport.email = 'username@web.com'
passport.password = 'ABC123'
passport.account = 123
loginResponse = client.service.login(passport)
print 'Login Response: '
print loginResponse.status

# Get a record
recordRef = client.factory.create('ns4:RecordRef')
recordRef._internalId = 127842
recordRef._type = 'invoice'
record = client.service.get(recordRef)
print record

您可能还需要尝试Python和SUDS版本的各种组合.它不是一个特别可靠的图书馆.

    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞