这是我的xml:
<?xml version="1.0"?>
<soapenv:Envelope>
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>USERNAME</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">1234</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<root xmlns="http://xmlns.oracle.com/Enterprise/tools/schema/InfoRtRequest.v1">
<EMAIL>david</EMAIL>
</root>
</soapenv:Body>
</soapenv:Envelope>
这是我的演示:
wsdl = ''
client = Client(
wsdl,
wsse=UsernameToken('USERNAME', '1234'))
response = client.service.get_method(
EMAIL='david')
它引发了 VaglidationError:
ValidationError: Missing element OPRID (root.OPRID)
不知道为什么,求大神帮忙,谢谢