我正在尝试使用Python连接Aramex提供SOAP,使用以下代码:
import suds
from suds.client import Client
client = Client('file:///home/test/test_wsdl_aramex/shipments-tracking-api-wsdl.wsdl',cache=None)但是,在开始之后,我得到了以下例外:
> raise Exception("portType '%s', not-found" % self.type)
Exception: portType 'i0:Service_dd1_0', not-found可以找到WSDL文件源这里。
发布于 2013-08-02 12:45:13
错误出现在这里:
<wsdl:binding type="i0:Service_1_0" name="BasicHttpBinding_Service_1_0">和
绑定元素有两个属性-- name和type。 name属性(您可以使用任意名称)定义绑定的名称,type属性指向绑定的端口,在本例中是"glossaryTerms“端口。
所以解析器找不到端口type="i0:Service_1_0",在这个wsdl文件中有两个端口定义:
<wsdl:portType name="Service_1_0">
<wsdl:operation name="TrackShipments">
<wsdl:input name="ShipmentTrackingRequest" message="tns:ShipmentTrackingRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/TrackShipments"/>
<wsdl:output name="ShipmentTrackingResponse" message="tns:ShipmentTrackingResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/TrackShipmentsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="Service_1_0">
<wsdl:port name="BasicHttpBinding_Service_1_0" binding="i0:BasicHttpBinding_Service_1_0">
<soap:address location="http://ws.aramex.net/shippingapi/tracking/service_1_0.svc"/>
</wsdl:port>
</wsdl:service>所以现在您知道了什么是错误的(在wsdl:binding中更改类型),并且您无法通过对它的验证。
https://stackoverflow.com/questions/17999476
复制相似问题