Calling Web Services from Python

Ivan Zuzak ivan.zuzak at fer.hr
Tue Apr 11 03:53:47 EDT 2006


m.banaouas wrote:
> Can you tell us more about SOAPpy bug ?
> Is it about authentication ?
> 
> Ivan Zuzak a écrit :
> 
>> ...
>> I need a package/tool that generates web service proxies that will do 
>> all the low-level HTTP work. (Someting like the WSDL.EXE tool in .NET 
>> Framework) The ZSI and SOAPy packages [1] that i found (should) have 
>> those functionalities but either have a bug (SOAPy) or either do not 
>> work for arbitrary web services (ZSI). ...

SOAPy : http://soapy.sourceforge.net/
SOAPPy : http://pywebsvcs.sourceforge.net/

The bugged one is SOAPy (parsing errors and something else). I just
downloaded and tried SOAPPy and that one crashes too. I get an "Index
out of range" error while parsing the wsdl ( in XMLSchema.py ). The
traceback is a bit long, so I wont list the whole thing here.

Bellow this message is the wsdl of the service for which im trying to
get a proxy. If anyone manages to get a proxy out of it - please let me
know :).

Thank you for your help,
Ivan

//////////////////////// WSDL START ////////////////////////////////

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s1="http://www.ris.fer.hr/overlay/addressing"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s3="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/MessageStatistics" 

xmlns:s2="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/XmlDoc"
xmlns:s4="http://ris.zemris.fer.hr/remotingSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox" 

xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox" 

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <wsdl:types>
     <s:schema elementFormDefault="qualified"
targetNamespace="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox">
       <s:import namespace="http://www.ris.fer.hr/overlay/addressing" />
       <s:import
namespace="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/XmlDoc" 

/>
       <s:element name="Create">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="0" maxOccurs="1" name="mbID"
type="s:string" />
             <s:element minOccurs="0" maxOccurs="1"
ref="s1:EndpointReference" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="CreateResponse">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="1" maxOccurs="1" name="CreateResult"
type="s:boolean" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="ResourceID" type="tns:ResourceID" />
       <s:complexType name="ResourceID" mixed="true">
         <s:annotation>
           <s:appinfo>
             <keepNamespaceDeclarations>xmlns</keepNamespaceDeclarations>
           </s:appinfo>
         </s:annotation>
       </s:complexType>
       <s:element name="Destroy">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="0" maxOccurs="1"
ref="s1:EndpointReference" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="DestroyResponse">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="1" maxOccurs="1" name="DestroyResult"
type="s:boolean" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="PutMessage">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="1" maxOccurs="1" ref="s2:xmlDoc" />
             <s:element minOccurs="0" maxOccurs="1"
ref="s1:EndpointReference" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="PutMessageResponse">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="1" maxOccurs="1"
name="PutMessageResult" type="s:boolean" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="GetMessage">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="1" maxOccurs="1" name="timeParam"
type="s:int" />
             <s:element minOccurs="0" maxOccurs="1" name="cb"
type="s:string" />
             <s:element minOccurs="0" maxOccurs="1"
ref="s1:EndpointReference" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="GetMessageResponse">
         <s:complexType>
           <s:sequence>
             <s:any minOccurs="0" maxOccurs="1" />
           </s:sequence>
         </s:complexType>
       </s:element>
       <s:element name="FlushPerformanceLog">
         <s:complexType />
       </s:element>
       <s:element name="FlushPerformanceLogResponse">
         <s:complexType />
       </s:element>
       <s:element name="GetPerformanceLog">
         <s:complexType />
       </s:element>
       <s:element name="GetPerformanceLogResponse">
         <s:complexType>
           <s:sequence>
             <s:element minOccurs="0" maxOccurs="1"
name="GetPerformanceLogResult">
               <s:complexType mixed="true">
                 <s:sequence>
                   <s:any />
                 </s:sequence>
               </s:complexType>
             </s:element>
           </s:sequence>
         </s:complexType>
       </s:element>
     </s:schema>
     <s:schema elementFormDefault="qualified"
targetNamespace="http://www.ris.fer.hr/overlay/addressing">
       <s:element name="EndpointReference"
type="s1:EndpointReferenceType" />
       <s:complexType name="EndpointReferenceType">
         <s:annotation>
           <s:appinfo>
             <keepNamespaceDeclarations>xmlns</keepNamespaceDeclarations>
           </s:appinfo>
         </s:annotation>
         <s:sequence>
           <s:element minOccurs="0" maxOccurs="1" name="Address"
type="s1:AttributedURI" />
           <s:element minOccurs="0" maxOccurs="1" name="RemotingAddress"
type="s1:AttributedURI" />
           <s:element minOccurs="0" maxOccurs="1"
name="ReferenceProperties" type="s1:ReferencePropertiesType" />
           <s:element minOccurs="0" maxOccurs="1" name="PortType"
type="s1:AttributedQName" />
           <s:element minOccurs="0" maxOccurs="1" name="ServiceName"
type="s1:ServiceNameType" />
           <s:element minOccurs="0" maxOccurs="1" name="To"
type="s1:AttributedURI" />
           <s:element minOccurs="0" maxOccurs="1" name="From"
type="s1:EndpointReferenceType" />
         </s:sequence>
       </s:complexType>
       <s:complexType name="AttributedURI">
         <s:simpleContent>
           <s:extension base="s:anyURI" />
         </s:simpleContent>
       </s:complexType>
       <s:complexType name="ReferencePropertiesType">
         <s:annotation>
           <s:appinfo>
             <keepNamespaceDeclarations>xmlns</keepNamespaceDeclarations>
           </s:appinfo>
         </s:annotation>
         <s:sequence>
           <s:any minOccurs="0" maxOccurs="unbounded" />
         </s:sequence>
       </s:complexType>
       <s:complexType name="AttributedQName">
         <s:simpleContent>
           <s:extension base="s:QName" />
         </s:simpleContent>
       </s:complexType>
       <s:complexType name="ServiceNameType">
         <s:simpleContent>
           <s:extension base="s:QName">
             <s:attribute name="PortName" type="s:NCName" />
           </s:extension>
         </s:simpleContent>
       </s:complexType>
       <s:element name="FacilityID" type="s1:FacilityID" />
       <s:complexType name="FacilityID" mixed="true">
         <s:annotation>
           <s:appinfo>
             <keepNamespaceDeclarations>xmlns</keepNamespaceDeclarations>
           </s:appinfo>
         </s:annotation>
       </s:complexType>
       <s:element name="To" type="s1:ToAttributedURI" />
       <s:complexType name="ToAttributedURI" mixed="true">
         <s:anyAttribute />
       </s:complexType>
     </s:schema>
     <s:schema elementFormDefault="qualified"
targetNamespace="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/XmlDoc">
       <s:element name="xmlDoc" nillable="true" type="s2:XmlDoc" />
       <s:complexType name="XmlDoc" mixed="true">
         <s:sequence>
           <s:any minOccurs="0" maxOccurs="unbounded" />
         </s:sequence>
         <s:anyAttribute />
       </s:complexType>
     </s:schema>
     <s:schema elementFormDefault="qualified"
targetNamespace="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/MessageStatistics">
       <s:element name="MessageStatistics" type="s3:MessageStatistics" />
       <s:complexType name="MessageStatistics">
         <s:sequence>
           <s:element minOccurs="1" maxOccurs="1" name="messageWaiting"
type="s:double" />
         </s:sequence>
       </s:complexType>
     </s:schema>
     <s:schema elementFormDefault="qualified"
targetNamespace="http://ris.zemris.fer.hr/remotingSchema">
       <s:element name="service" type="s4:Service" />
       <s:complexType name="Service">
         <s:sequence>
           <s:element minOccurs="0" maxOccurs="1" name="class"
type="s4:Classes" />
         </s:sequence>
         <s:attribute name="name" type="s:string" />
         <s:attribute name="location" type="s:string" />
       </s:complexType>
       <s:complexType name="Classes">
         <s:sequence>
           <s:element minOccurs="0" maxOccurs="unbounded" name="method"
type="s4:Methods" />
         </s:sequence>
         <s:attribute name="name" type="s:string" />
         <s:attribute name="namespace" type="s:string" />
       </s:complexType>
       <s:complexType name="Methods">
         <s:sequence>
           <s:element minOccurs="0" maxOccurs="unbounded" name="param"
type="s4:Params" />
         </s:sequence>
         <s:attribute name="name" type="s:string" />
         <s:attribute name="returnType" type="s:string" />
       </s:complexType>
       <s:complexType name="Params">
         <s:attribute name="name" type="s:string" />
         <s:attribute name="type" type="s:string" />
       </s:complexType>
     </s:schema>
   </wsdl:types>
   <wsdl:message name="CreateSoapIn">
     <wsdl:part name="parameters" element="tns:Create" />
   </wsdl:message>
   <wsdl:message name="CreateSoapOut">
     <wsdl:part name="parameters" element="tns:CreateResponse" />
   </wsdl:message>
   <wsdl:message name="CreateFacilityID">
     <wsdl:part name="FacilityID" element="s1:FacilityID" />
   </wsdl:message>
   <wsdl:message name="CreateResourceID">
     <wsdl:part name="ResourceID" element="tns:ResourceID" />
   </wsdl:message>
   <wsdl:message name="CreateTo">
     <wsdl:part name="To" element="s1:To" />
   </wsdl:message>
   <wsdl:message name="DestroySoapIn">
     <wsdl:part name="parameters" element="tns:Destroy" />
   </wsdl:message>
   <wsdl:message name="DestroySoapOut">
     <wsdl:part name="parameters" element="tns:DestroyResponse" />
   </wsdl:message>
   <wsdl:message name="DestroyFacilityID">
     <wsdl:part name="FacilityID" element="s1:FacilityID" />
   </wsdl:message>
   <wsdl:message name="DestroyResourceID">
     <wsdl:part name="ResourceID" element="tns:ResourceID" />
   </wsdl:message>
   <wsdl:message name="DestroyTo">
     <wsdl:part name="To" element="s1:To" />
   </wsdl:message>
   <wsdl:message name="PutMessageSoapIn">
     <wsdl:part name="parameters" element="tns:PutMessage" />
   </wsdl:message>
   <wsdl:message name="PutMessageSoapOut">
     <wsdl:part name="parameters" element="tns:PutMessageResponse" />
   </wsdl:message>
   <wsdl:message name="PutMessageFacilityID">
     <wsdl:part name="FacilityID" element="s1:FacilityID" />
   </wsdl:message>
   <wsdl:message name="PutMessageResourceID">
     <wsdl:part name="ResourceID" element="tns:ResourceID" />
   </wsdl:message>
   <wsdl:message name="PutMessageTo">
     <wsdl:part name="To" element="s1:To" />
   </wsdl:message>
   <wsdl:message name="GetMessageSoapIn">
     <wsdl:part name="parameters" element="tns:GetMessage" />
   </wsdl:message>
   <wsdl:message name="GetMessageSoapOut">
     <wsdl:part name="parameters" element="tns:GetMessageResponse" />
   </wsdl:message>
   <wsdl:message name="GetMessageFacilityID">
     <wsdl:part name="FacilityID" element="s1:FacilityID" />
   </wsdl:message>
   <wsdl:message name="GetMessageResourceID">
     <wsdl:part name="ResourceID" element="tns:ResourceID" />
   </wsdl:message>
   <wsdl:message name="GetMessageTo">
     <wsdl:part name="To" element="s1:To" />
   </wsdl:message>
   <wsdl:message name="GetMessageMessageStatistics">
     <wsdl:part name="MessageStatistics" element="s3:MessageStatistics" />
   </wsdl:message>
   <wsdl:message name="FlushPerformanceLogSoapIn">
     <wsdl:part name="parameters" element="tns:FlushPerformanceLog" />
   </wsdl:message>
   <wsdl:message name="FlushPerformanceLogSoapOut">
     <wsdl:part name="parameters"
element="tns:FlushPerformanceLogResponse" />
   </wsdl:message>
   <wsdl:message name="GetPerformanceLogSoapIn">
     <wsdl:part name="parameters" element="tns:GetPerformanceLog" />
   </wsdl:message>
   <wsdl:message name="GetPerformanceLogSoapOut">
     <wsdl:part name="parameters" element="tns:GetPerformanceLogResponse" />
   </wsdl:message>
   <wsdl:message name="GetPerformanceLogservice">
     <wsdl:part name="service" element="s4:service" />
   </wsdl:message>
   <wsdl:portType name="MailBoxSoap">
     <wsdl:operation name="Create">
       <wsdl:input message="tns:CreateSoapIn" />
       <wsdl:output message="tns:CreateSoapOut" />
     </wsdl:operation>
     <wsdl:operation name="Destroy">
       <wsdl:input message="tns:DestroySoapIn" />
       <wsdl:output message="tns:DestroySoapOut" />
     </wsdl:operation>
     <wsdl:operation name="PutMessage">
       <wsdl:input message="tns:PutMessageSoapIn" />
       <wsdl:output message="tns:PutMessageSoapOut" />
     </wsdl:operation>
     <wsdl:operation name="GetMessage">
       <wsdl:input message="tns:GetMessageSoapIn" />
       <wsdl:output message="tns:GetMessageSoapOut" />
     </wsdl:operation>
     <wsdl:operation name="FlushPerformanceLog">
       <wsdl:input message="tns:FlushPerformanceLogSoapIn" />
       <wsdl:output message="tns:FlushPerformanceLogSoapOut" />
     </wsdl:operation>
     <wsdl:operation name="GetPerformanceLog">
       <wsdl:input message="tns:GetPerformanceLogSoapIn" />
       <wsdl:output message="tns:GetPerformanceLogSoapOut" />
     </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="MailBoxSoap" type="tns:MailBoxSoap">
     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
     <wsdl:operation name="Create">
       <soap:operation
soapAction="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/Create" 

style="document" />
       <wsdl:input>
         <soap:body use="literal" />
         <soap:header message="tns:CreateFacilityID" part="FacilityID"
use="literal" />
         <soap:header message="tns:CreateTo" part="To" use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
         <soap:header message="tns:CreateResourceID" part="ResourceID"
use="literal" />
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="Destroy">
       <soap:operation
soapAction="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/Destroy" 

style="document" />
       <wsdl:input>
         <soap:body use="literal" />
         <soap:header message="tns:DestroyFacilityID" part="FacilityID"
use="literal" />
         <soap:header message="tns:DestroyResourceID" part="ResourceID"
use="literal" />
         <soap:header message="tns:DestroyTo" part="To" use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="PutMessage">
       <soap:operation
soapAction="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/PutMessage" 

style="document" />
       <wsdl:input>
         <soap:body use="literal" />
         <soap:header message="tns:PutMessageFacilityID"
part="FacilityID" use="literal" />
         <soap:header message="tns:PutMessageResourceID"
part="ResourceID" use="literal" />
         <soap:header message="tns:PutMessageTo" part="To" use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="GetMessage">
       <soap:operation
soapAction="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/GetMessage" 

style="document" />
       <wsdl:input>
         <soap:body use="literal" />
         <soap:header message="tns:GetMessageFacilityID"
part="FacilityID" use="literal" />
         <soap:header message="tns:GetMessageResourceID"
part="ResourceID" use="literal" />
         <soap:header message="tns:GetMessageTo" part="To" use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
         <soap:header message="tns:GetMessageMessageStatistics"
part="MessageStatistics" use="literal" />
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="FlushPerformanceLog">
       <soap:operation
soapAction="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/FlushPerformanceLog" 

style="document" />
       <wsdl:input>
         <soap:body use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="GetPerformanceLog">
       <soap:operation
soapAction="http://www.ris.fer.hr/OpenCollectives/CoopetitionServices/MailBox/GetPerformanceLog" 

style="document" />
       <wsdl:input>
         <soap:body use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
         <soap:header message="tns:GetPerformanceLogservice"
part="service" use="literal" />
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="MailBox">
     <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
     <wsdl:port name="MailBoxSoap" binding="tns:MailBoxSoap">
       <soap:address
location="http://localhost/coopetitionservices/mailbox/MailBox.asmx" />
     </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

//////////////////////////// WSDL END /////////////////////////////




More information about the Python-list mailing list