473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Calling Web Services from Python

Hello,

My Python application calls web services available on the Internet. The
web service being called is defined through application user input.

The Python built-in library allows access to web services using HTTP
protocol, which is not acceptible - generating SOAP messages for
arbitrary web services is something i wish to avoid.

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). I tried the ZSI wsdl2py script on
a wsdl of one of my services, and the script crashes. I suppose the wsdl
was "too hard" for the script to parse.

Are there any other packages that utilize generation of web service
proxies that are compatible with SOAP & WSDL standards?

Thank you,
ivan zuzak

[1] - http://pywebsvcs.sourceforge.net/
Apr 7 '06 #1
3 4248
Ivan Zuzak wrote:
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).


You might want to read this, specifically 12.5 and 12.6 for WSDL:
http://diveintopython.org/soap_web_services/index.html

It uses SOAPpy, which may or may not be different than SOAPy, depending
on if you made a typo or not. :)
Apr 7 '06 #2
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).
...

Apr 9 '06 #3
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 /////////////////////////////

Apr 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: David MacQuigg | last post by:
I am starting a new thread so we can avoid some of the non-productive argument following my earlier post "What is good about Prothon". At Mr. Hahn's request, I will avoid using the name "Prothon"...
9
by: F. GEIGER | last post by:
I've dev'ed a Python prototype of an app, that besides the internals making it up has a gui. While test-driven dev'ing the app's internals in Python is fun as usual, dev'ing the GUI is not so...
2
by: lamthierry | last post by:
Let's say I have a python function do some math like the following: def doMath(self): self.val = self.val + 1 How can I call this python function from C++? Assuming I have some sort of...
2
by: Kevin | last post by:
i have a python file called pyq which outputs stock quotes, currently i also have a html file that takes stock ticker inputs, i would like to bridge the two by building another program that takes...
5
by: Shuaib | last post by:
Hi! I have a python script which returns an Integer value. How do I call this script from a C programe, and use the result returned? Thanks for your time.
1
by: jvframework | last post by:
I have a C# .NET cliente calling a Python web services. I pass two string values to web service and I wanna receive a string from the method. But, the server side receive my string values and...
0
by: Jeff Rush | last post by:
For those who write books and articles, I've established a wiki page just as we already have a page for those who offer training services for Python. If you would like to be reachable by those...
3
by: ShambhuHubli | last post by:
Hi all!! .. I am New member to this group. And also new to C/PYTHON API coding. I am trying to have two way communication i,e i am calling from python to C and then from C to python. I have no...
23
by: Harishankar | last post by:
Hi, Sorry to start off on a negative note in the list, but I feel that the Python subprocess module is sorely deficient because it lacks a mechanism to: 1. Create non-blocking pipes which can...
2
by: vgkhle | last post by:
hi all How can diff python scripts be called from a main script which is again a .py? os.system("python external_script.py") works fine, but what if I want to handle the un handled...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.