:파이썬 SOAPpy 웹 서비스 호출에있어 문제점은 무엇입니까?
from SOAPpy import WSDL
wsdl = "http://www.webservicex.net/whois.asmx?wsdl"
proxy = WSDL.Proxy(wsdl)
proxy.soapproxy.config.dumpSOAPOut=1
proxy.soapproxy.config.dumpSOAPIn=1
proxy.GetWhoIS(HostName="google.com")
가 (그래, 나는 diveintopython의 일을하고, 파이썬에 새로 온 사람 ...)
GetWhoIS 메서드 호출이 실패합니다. 그렇지 않으면 여기에서 묻지 않을 것입니다. 여기에 보내는 SOAP입니다 :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<GetWhoIS SOAP-ENC:root="1">
<HostName xsi:type="xsd:string">google.com</HostName>
</GetWhoIS>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
그리고 여기 들어오는 응답입니다.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>
System.Web.Services.Protocols.SoapException:
Server was unable to process request. --->
System.ArgumentNullException: Value cannot be null.
at whois.whois.GetWhoIS(String HostName)
--- End of inner exception stack trace ---
</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
은 (수동으로 쉽게 읽을 포맷)
사람이 내가 잘못 뭐하는 거지 말씀해 주시겠습니까?
SOAPpy의 사용 측면과 SOAP 메시지가 올바르지 않은 이유 모두에서 이상적입니다.
감사합니다.