0
我正在使用soaplib(python)創建webservices服務器。soaplib - python - 標題中缺少名稱空間
我已經實現了一個方法並生成了一個wsdl,以便任何soap客戶端都可以輕鬆使用webservice。
我使用soapUI來驗證我的web服務,並且soapUI說響應不正常。
我發現了什麼是錯誤的XML,但不能使soapLib正確的使用方法......
這裏是我的PythonClass:
class AgentSoapManager(SimpleWSGISoapApp):
""" Interface for web services """
@soapmethod(String, _returns = String)
def get_streaming_url(self, application_identifier):
returns "rtsp://192.168.10.224:51081/camera8"
我使用WSGIServer。
這裏是我的電話(根據soapUI的是OK):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:agen="agent.soap.AgentSoapManager.AgentSoapManager">
<soapenv:Header/>
<soapenv:Body>
<agen:get_streaming_url>
<application_identifier>0800275ec350_jaguar_8</application_identifier>
</agen:get_streaming_url>
</soapenv:Body>
</soapenv:Envelope>
這裏是我的web
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<get_streaming_urlResponse>
<get_streaming_urlResult xsi:type="xs:string">
rtsp://192.168.10.224:51081/camera8
</get_streaming_urlResult>
</get_streaming_urlResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
這裏的錯誤響應的錯誤:
line-1: Missing part with name [{agent.soap.AgentSoapManager.AgentSoapManager}get_streaming_urlResponse
下面是我發現的答覆,根據soapUI
<SOAP-ENV:Envelope xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:agen="agent.soap.AgentSoapManager.AgentSoapManager">
<SOAP-ENV:Body>
<agen:get_streaming_urlResponse>
<get_streaming_urlResult>
rtsp://192.168.10.224:51081/camera8
</get_streaming_urlResult>
</agen:get_streaming_urlResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>