用Zeep读SOAP

时间:2017-06-12 16:03:25

标签: python soap zeep

我试图阅读此Soap API' https://www.shab.ch/soapserver'使用Python Zeep

from requests import Session
from requests.auth import HTTPBasicAuth
from zeep import Client

from zeep.transports import Transport
session = Session()
session.auth = HTTPBasicAuth('MYUSERNAME', 'MYPASSWORD')
client = Client('https://www.shab.ch/shabforms/acmsservice?wsdl',
    transport=Transport(session=session))

但是请收到以下错误消息:

HTTPError: 403 Client Error: Forbidden for url: 
https://www.shab.ch/shabforms/acmsservice?wsdl

有人可以在这里看到我做错了什么吗?

2 个答案:

答案 0 :(得分:0)

Python似乎不是你的问题。相反,您有WSDL文件的权限问题。一个快速的谷歌搜索出现了:

https://www.shab.ch/soapserver https://www.shab.ch/shabforms/soapserver?wsdl

答案 1 :(得分:0)

您无权访问Shab.ch服务器的该部分。您需要用户名和密码。联系方式:info@sogc.ch