使用 python suds 访问 WSDL-Service 时出现问题引发 TypeNotFound: ArrayOfint
未找到类型:'(ArrayOfint,http://schemas.microsoft.com/2003/ 10/序列化/数组, )' 是肥皂水解析器产生的。 在...2003/10/Serialization/Arrays中定义了ArrayOfInt,所以我猜linux的大小写敏感性是问题所在。 知道如何解决这个问题吗?
from suds.client import Client
c = Client("https://developer-api.affili.net/V2.0/Logon.svc?wsdl")
一个
Type not found: '(ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays, )'
自从几天后我就不再去那里了,但我却得到了
TypeNotFound: Type not found: '(Logon, http://affilinet.framework.webservices/types, )'
Type not found: '(ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays, )'
is what suds resolver raises.
In ...2003/10/Serialization/Arrays ArrayOfInt is defined, so I guess linux' case sensitivity is the problem.
Any Idea how I can get around that?
from suds.client import Client
c = Client("https://developer-api.affili.net/V2.0/Logon.svc?wsdl")
used to return
Type not found: '(ArrayOfint, http://schemas.microsoft.com/2003/10/Serialization/Arrays, )'
now since a few days I don't even get there anymore but instead I get a
TypeNotFound: Type not found: '(Logon, http://affilinet.framework.webservices/types, )'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您的 WSDL 损坏了。您需要在此处使用提供的
ImportDoctor
由 SUDS 提供。您需要使用它来帮助Client
构造函数使用http://schemas.microsoft.com/2003/10/Serialization/Arrays< 中找到的
ArrayOfint
类型/代码>。我过去曾使用其他服务完成此操作,但没有看到您的 WSDL 或代码,这只是我对如何修复它的最佳猜测,因为我无法自己测试它:
值得注意的一件事是 URL < a href="http://schemas.microsoft.com/2003/10/Serialization/Arrays" rel="noreferrer">http://schemas.microsoft.com/2003/10/Serialization/Arrays 是甚至无效(它返回 404),所以我真的不确定这是正确的 URL。尽管我有信心至少引导你走向正确的方向。
编辑以回应您最近的评论 (2010-10-05):
使用您提供的 URL
https://developer-api.affili.net/V2.0/Logon.svc ?wsdl
我能够成功创建客户端。我必须使用ImportDoctor
因为它引发了以下错误:因此我使用了以下代码并且能够获得成功的客户端对象:
打印客户端对象会显示以下内容:
Suds ( https://fedorahosted.org/suds/ ) 版本:0.3.9 GA 版本:R659-20100219
在您可以使用
之前client.service.Logon()
您必须满足该方法所需的类型签名。您必须使用client.factory.create()
创建各种类型对象(例如client.factory.create('ns0:WebServiceTypes')
)并传递这些对象以及您的用户名/密码。Sounds like you have a broken WSDL. This is where you'll need to use the
ImportDoctor
provided by SUDS. You need use this to help theClient
constructor use theArrayOfint
type found athttp://schemas.microsoft.com/2003/10/Serialization/Arrays
.I have done this in the past with other services but without seeing your WSDL or your code, this is only my best guess as to how you may fix it because I can't test it myself:
One thing worth noting is that the URL http://schemas.microsoft.com/2003/10/Serialization/Arrays is not even valid (it returns a 404), so I am really not sure that is the right URL. Although I am confident that I am at least steering you in the right direction.
Edit in response to your recent comment (2010-10-05):
Using the URL you provided of
https://developer-api.affili.net/V2.0/Logon.svc?wsdl
I was able to successfully create a client. I had to use anImportDoctor
because it raised the following error:So I used the following code and was able to get a successful client object:
Printing the client object displays this:
Suds ( https://fedorahosted.org/suds/ ) version: 0.3.9 GA build: R659-20100219
Before you can use
client.service.Logon()
you're going to have to satisfy the type signature required by that method. You'll have to create various type objects usingclient.factory.create()
(e.g.client.factory.create('ns0:WebServiceTypes')
) and pass those objects along with your username/password.