有谁能够让肥皂库与 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'
Has anyone been able to get the suds soap library to work with the NetSuite WSDL? I get this error when I try to create a client.
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'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的,suds 可以连接到 NetSuite,但处理 WSDL 需要很长时间。
以下是一些示例代码:
您可能还需要尝试 Python 和 SUDS 版本的各种组合。它不是一个特别可靠的库。
Yes, suds can connect to NetSuite, but it takes a long time to process the WSDL.
Here's some sample code:
You might also need to try various combinations of Python and SUDS versions. It's not a particularly reliable library.
虽然有点晚了,但为了记录,我附上了一种如何使用的方法
使用 Python Zeep 的 NetSuite SuiteTalk SOAP API。
使用 Python 和 Zeep 进行 NetSuite SOAP 登录并添加客户的示例。
另请参阅:https://github.com/fmalina/python-netsuite
It is a bit late, but for the record I attach a way of how one can work with
NetSuite SuiteTalk SOAP API using Python Zeep.
Example of NetSuite SOAP login with Python and Zeep followed by adding a customer.
See also: https://github.com/fmalina/python-netsuite
虽然这不是最好的方法,但如果您绝望的话,您可以继续尝试他们的 wsdl 的不同版本。我收到了同样的错误消息,所以我不断尝试,直到成功为止。我按照这个顺序:
“https://webservices.netsuite.com/wsdl/v2009_1_0/netsuite.wsdl”终于为我工作了
编辑:
根据 tponthieux 的回答,我现在意识到您可以使用 suds 插件功能来修复 wsdl (我只是对他的回答发表评论,但我还没有声誉:( ):
Though not the best way to do things, if you're desperate, you can keep trying different versions of their wsdl. I was getting the same error message, so I kept trying until one worked. I went in this order:
'https://webservices.netsuite.com/wsdl/v2009_1_0/netsuite.wsdl' finally worked for me
EDIT:
Based on tponthieux's answer, I realize now that you can use the suds plugin feature to fix the wsdl (I would simply comment on his answer, but I don't have the reputation yet :( ):
如果您想对已保存的 WSDL 进行一次性修复,而不是每次都进行修复(这需要一段时间),这里是我使用的 VIM 替换命令 这
适用于 2010 Netsuite WSDL 并且还必须为 2012 Netsuite WSDL(您认为他们会在两年后修复它)
If you want to do a one-off fix on a saved WSDL instead of doing the fix every time (which takes a while) here is a VIM substitution command that I used
This works on the 2010 Netsuite WSDL and also had to do it for the 2012 Netsuite WSDL (you think they would have fixed it after two years)
https://webservices.netsuite.com/wsdl/v2010_2_0/netsuite.wsdl
之间的验证失败了
我发现这部分:和这部分:
:我将其更改
为:
修改允许 Suds 创建客户端。就像约翰提到的那样,解析确实需要很长时间(超过两分钟)。我还没有尝试使用 checkAsyncStatus 来查看它是否有效。
https://webservices.netsuite.com/wsdl/v2010_2_0/netsuite.wsdl
I found that it was failing on a validation between this part:
and this part:
I changed this:
to this:
The modification allows Suds to create the client. Like John mentioned, it does take forever to parse(more than two minutes). I haven't tried using checkAsyncStatus to see if it works.