2017-03-17 58 views
0

我創建了一個簡單的Web服務並將其與pysimplesoap一起使用。然後,我添加SSL的服務(自簽名),並試圖做同樣的,但我得到的錯誤:pysimplesoap無法確定WSDL中的服務:SOAP版本:soap11

RuntimeError:在WSDL無法確定服務:SOAP版本:soap11

這是我的代碼:

from pysimplesoap.client import SoapClient 
import base64 
import ssl 
base64string = base64.encodestring('%s:%s' % ('username', 'password')).replace('\n', '') 

ssl._create_default_https_context = ssl._create_unverified_context 
authenticationHeader = { 

    "Authorization" : "Basic %s" % base64string, 
} 
client = SoapClient(wsdl="https://10.0.120.138/service.svc?wsdl",trace=True,http_headers=authenticationHeader) 


response = client.method("param") 
print response 

有誰知道我爲什麼會出錯?我有一種感覺,我需要配置一些東西..

回答

0

這不是真正的上述問題的答案,但它是一個解決方案.. 我切換到zeep庫,現在一切正常。