如何从网站获取请求?我找到了这个: http://www.yodaspeak.co.uk/webservice/yodatalk.php?wsdl
但是我可以弄清楚如何向其发送请求并获得响应。
到目前为止,我已经尝试过:
guard
但是没有用。
import requests
yoda_params = {"inputText": 'Is this working?'}
yoda_url = 'http://www.yodaspeak.co.uk/webservice/yodatalk.php?'
yoda_re = requests.get(yoda_url, params=yoda_params)
yoda_text = yoda_re.json()
print(yoda_text)
在尝试将InputText = Something放入url时,我也错误地发现了这一点
更新:
我尝试使用zeep,但是当我运行Name: yodaTalk
Binding: http://www.yodaspeak.co.uk/webservice/yodatalkBinding
Endpoint: http://www.yodaspeak.co.uk/webservice/yodatalk.php
SoapAction: uri:http://www.yodaspeak.co.uk/webservice/yodatalk#yodaTalk
Style: rpc
Input:
use: literal
namespace: uri:http://www.yodaspeak.co.uk/webservice/yodatalk
encodingStyle:
message: yodaTalkRequest
parts:
inputText: xsd:string
Output:
use: literal
namespace: uri:http://www.yodaspeak.co.uk/webservice/yodatalk
encodingStyle:
message: yodaTalkResponse
parts:
return: xsd:string
Namespace: uri:http://www.yodaspeak.co.uk/webservice/yodatalk
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: Pass any string and it will be returned as Yoda-Speak.
时,我得到了:
python -mzeep 'http://www.yodaspeak.co.uk/webservice/yodatalk.php?wsdl
答案 0 :(得分:1)
尝试使用任何肥皂库(例如zeep)。
我想wsdl
中有http://www.yodaspeak.co.uk/webservice/yodatalk.php?wsdl
,所以大概是soap
在使用。