我正在尝试在https://sandbox.api.dell.com/support/case/v2/WebCase?wsdl
使用WSDL Web服务这是我尝试使用的python代码:
from suds.client import Client
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('suds.transport.http').setLevel(logging.DEBUG)
url = "https://sandbox.api.dell.com/support/case/v2/WebCase?wsdl"
client = Client(url)
print client
这是调试日志和我得到的例外
DEBUG:suds.wsdl:reading wsdl at: https://sandbox.api.dell.com/support/case/v2/WebCase?wsdl ...
DEBUG:suds.transport.http:opening (https://sandbox.api.dell.com/support/case/v2/WebCase?wsdl)
DEBUG:suds.metrics:<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="http://ph.services.dell.com/Server/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://ph.services.dell.com/Server/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema>
<xsd:import namespace="http://ph.services.dell.com/Server/" schemaLocation="https://sandbox.api.dell.com/support/case/v2/WebCase/_resources_/xsd/WCS_114346525.xsd"/>
</xsd:schema>
</types>
<message name="RegisterForCloudUIRequest">
<part element="tns:RegisterForCloudUIRequest" name="parameters"/>
</message>
<message name="RegisterForCloudUIResponse">
<part element="tns:RegisterForCloudUIResponse" name="parameters"/>
</message>
<message name="AlertOperationRequest">
<part element="tns:AlertRequest" name="parameters"/>
</message>
<message name="AlertOperationResponse">
<part element="tns:AlertResponse" name="parameters"/>
</message>
<message name="QueryCaseOperationRequest">
<part element="tns:QueryCaseRequest" name="parameters"/>
</message>
<message name="QueryCaseOperationResponse">
<part element="tns:QueryCaseResponse" name="parameters"/>
</message>
<message name="DeviceOperationRequest">
<part element="tns:DeviceRequest" name="parameters"/>
</message>
<message name="DeviceOperationResponse">
<part element="tns:DeviceResponse" name="parameters"/>
</message>
<portType name="WebCaseService_SOAP11HTTPS_client_Interface">
<operation name="RegisterForCloudUI">
<input message="ser:RegisterForCloudUIRequest" xmlns:ser="http://ph.services.dell.com/Server/"/>
<output message="ser:RegisterForCloudUIResponse" xmlns:ser="http://ph.services.dell.com/Server/"/>
</operation>
<operation name="AlertOperation">
<input message="ser:AlertOperationRequest" xmlns:ser="http://ph.services.dell.com/Server/"/>
<output message="ser:AlertOperationResponse" xmlns:ser="http://ph.services.dell.com/Server/"/>
</operation>
<operation name="QueryCaseOperation">
<input message="ser:QueryCaseOperationRequest" xmlns:ser="http://ph.services.dell.com/Server/"/>
<output message="ser:QueryCaseOperationResponse" xmlns:ser="http://ph.services.dell.com/Server/"/>
</operation>
<operation name="DeviceOperation">
<input message="ser:DeviceOperationRequest" xmlns:ser="http://ph.services.dell.com/Server/"/>
<output message="ser:DeviceOperationResponse" xmlns:ser="http://ph.services.dell.com/Server/"/>
</operation>
</portType>
<binding name="WebCaseService_SOAP11HTTPS_client_Binding" type="ser:WebCaseService_SOAP11HTTPS_client_Interface" xmlns:ser="http://ph.services.dell.com/Server/">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="RegisterForCloudUI">
<soap:operation soapAction="http://ph.services.dell.com/Server/RegisterForCloudUI"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="AlertOperation">
<soap:operation soapAction="http://ph.services.dell.com/Server/AlertOperation"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="QueryCaseOperation">
<soap:operation soapAction="http://ph.services.dell.com/Server/QueryCaseOperation"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="DeviceOperation">
<soap:operation soapAction="http://ph.services.dell.com/Server/DeviceOperation"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WebCaseService_SOAP11HTTPS_client">
<port name="WebCaseService_SOAP11HTTPS_client" binding="ser:WebCaseService_SOAP11HTTPS_client_Binding" xmlns:ser="http://ph.services.dell.com/Server/">
<soap:address location="https://sandbox.api.dell.com/support/case/v2/WebCase"/>
</port>
</service>
</definitions>
sax duration: 9 (ms)
例外:
Traceback (most recent call last):
File "./test.py", line 11, in <module>
client = Client(url)
File "/usr/lib/python2.6/site-packages/suds/client.py", line 112, in __init__
self.wsdl = reader.open(url)
File "/usr/lib/python2.6/site-packages/suds/reader.py", line 152, in open
d = self.fn(url, self.options)
File "/usr/lib/python2.6/site-packages/suds/wsdl.py", line 158, in __init__
self.resolve()
File "/usr/lib/python2.6/site-packages/suds/wsdl.py", line 207, in resolve
c.resolve(self)
File "/usr/lib/python2.6/site-packages/suds/wsdl.py", line 491, in resolve
qref = qualify(op.input, self.root, definitions.tns)
File "/usr/lib/python2.6/site-packages/suds/xsd/__init__.py", line 56, in qualify
raise Exception('prefix (%s) not resolved' % p)
Exception: prefix (ser) not resolved
我看过类似的问题,触发了“异常:前缀( somestring )未解决”,但我无法从其他解决方案中解决这个问题。任何人都可以帮我解决这个问题吗?