import suds.client
url = 'http://127.0.0.1'
client = suds.client.Client(url,faults=False)
service = client.service
result = service.TestHelloWorld()
Traceback (most recent call last):
File "D:\Install\python3\lib\urllib\request.py", line 1317, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "D:\Install\python3\lib\http\client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:\Install\python3\lib\http\client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:\Install\python3\lib\http\client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\Install\python3\lib\http\client.py", line 1016, in _send_output
self.send(msg)
File "D:\Install\python3\lib\http\client.py", line 956, in send
self.connect()
File "D:\Install\python3\lib\http\client.py", line 928, in connect
(self.host,self.port), self.timeout, self.source_address)
File "D:\Install\python3\lib\socket.py", line 727, in create_connection
raise err
File "D:\Install\python3\lib\socket.py", line 716, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061]
Traceback (most recent call last):
File "F:\src\python\call_webservice_interface.py", line 15, in <module>
result = service.TestDB()
File "D:\Install\python3\lib\site-packages\suds\client.py", line 521, in __call__
return client.invoke(args, kwargs)
File "D:\Install\python3\lib\site-packages\suds\client.py", line 581, in invoke
result = self.send(soapenv)
File "D:\Install\python3\lib\site-packages\suds\client.py", line 613, in send
reply = self.options.transport.send(request)
File "D:\Install\python3\lib\site-packages\suds\transport\https.py", line 66, in send
return HttpTransport.send(self, request)
File "D:\Install\python3\lib\site-packages\suds\transport\http.py", line 82, in send
fp = self.u2open(u2request)
File "D:\Install\python3\lib\site-packages\suds\transport\http.py", line 132, in u2open
return url.open(u2request, timeout=tm)
File "D:\Install\python3\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "D:\Install\python3\lib\urllib\request.py", line 543, in _open
'_open', req)
File "D:\Install\python3\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "D:\Install\python3\lib\urllib\request.py", line 1345, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "D:\Install\python3\lib\urllib\request.py", line 1319, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10061]
Os是胜利10。不使用代理,端口处于服务状态,wsdl可以获取。
C#可以正常访问Web服务界面。
url是整体的一部分。
如果您使用肥皂水或konw这个错误。
请告诉我这段代码有什么问题,非常感谢。