How to create Web Service in Python

911 views
Skip to first unread message

velappan velappan

unread,
Feb 26, 2009, 11:21:49 AM2/26/09
to Python Ireland, vela.v...@aspiresys.com
Hi All,

I need to create web service in python.Is it possible in python if
its how we can able to create.
can any one help me on this


Thanks & regards
Vela.Velappan

Michael Thompson

unread,
Feb 26, 2009, 11:55:27 AM2/26/09
to python...@googlegroups.com, vela.v...@aspiresys.com
2009/2/26 velappan velappan <vela...@gmail.com>:

>
> Hi All,
>
> I need to create  web service in python.Is it possible in python if
> its how we can able to create.
> can any one help me on this

What did you have in mind?

pySoap any good?

Sean O'Donnell

unread,
Feb 26, 2009, 12:00:10 PM2/26/09
to python...@googlegroups.com
http://utilitymill.com/

makes it easy to create python web based utilities,
and automatically exposes them as rest services

Kevin Noonan

unread,
Feb 26, 2009, 4:14:44 PM2/26/09
to python...@googlegroups.com
Hi Velappan,

Chapter 12 of "RESTful Web Services" (O'Reilly) has an example of a
web service implementation in Python (using the Django web framework).

http://oreilly.com/catalog/9780596529260/

Even if you don't buy the book, you can download the sample code for
the chapter.


Also, you could host your web-service on Google App Engine.

A couple of how-to articles, using XML-RPC and JSON-RPC:

http://appengine-cookbook.appspot.com/recipe/xml-rpc-server-using-google-app-engine/
http://code.google.com/appengine/articles/rpc.html

And a code sample with JSON-RPC:
http://code.google.com/p/gae-jsonrpc-example/


I hope the above helps!

Kevin.

velappan velappan

unread,
Feb 26, 2009, 11:47:46 PM2/26/09
to Python Ireland
Thanks Kevin!

I am about to go thru the article which you have sent to me.

My exact requirement is like , I have to fetch few data's from my
database and i have to convert my data's into XML format. I have done
the method to fetch the data's.

It would be great if you guide me to how to convert my data's into
XML format also how to configure my data's in apache.

i.e.) My web service will have a text field named user name and if I
enter user name it should list me the
project name for the particular user in XML FORMAT.

Thank you once again!
~Vela







On Feb 27, 2:14 am, Kevin Noonan <knoo...@gmail.com> wrote:
> Hi Velappan,
>
> Chapter 12 of "RESTful Web Services" (O'Reilly) has an example of a
> web service implementation in Python (using the Django web framework).
>
> http://oreilly.com/catalog/9780596529260/
>
> Even if you don't buy the book, you can download the sample code for
> the chapter.
>
> Also, you could host your web-service on Google App Engine.
>
> A couple of how-to articles, using XML-RPC and JSON-RPC:
>
> http://appengine-cookbook.appspot.com/recipe/xml-rpc-server-using-goo...http://code.google.com/appengine/articles/rpc.html

Kevin Noonan

unread,
Feb 28, 2009, 11:42:06 AM2/28/09
to python...@googlegroups.com
Hi Vela,

If you're following one of the articles and using Google App Engine,
you'll be leaving your Apache, your current server hosting and
database behind and adopting Google's infrastructure--in that case,
see the docs at http://appengine.google.com to get going.

That may be too radical an option...

If you're just using Django, you can set up Django with Apache (on
your own server, with whatever database you're using now). See the
extensive docs on www.djangoproject.com.

Here's another example of using Django with XML-RPC, which will output
XML using SimpleXMLRPCDispatcher:
http://code.djangoproject.com/wiki/XML-RPC

Good luck!

Kevin.

velappan velappan

unread,
Mar 1, 2009, 6:52:58 AM3/1/09
to Python Ireland
Hi Kelvin,

Thanks for your information will have look on those things. But we
have not used Django. We will try to do if it suits for us. Thanks
once again for your information all. Will work on those stuffs and
keep this post updated :)


Thanks & regards
Vela

On Feb 28, 9:42 pm, Kevin Noonan <knoo...@gmail.com> wrote:
> Hi Vela,
>
> If you're following one of the articles and using Google App Engine,
> you'll be leaving your Apache, your current server hosting and
> database behind and adopting Google's infrastructure--in that case,
> see the docs athttp://appengine.google.comto get going.

velappan velappan

unread,
Mar 4, 2009, 11:51:40 PM3/4/09
to Python Ireland
Hi All,

I am in the process of creating Web service using SOAPpy.

I have created method to fetch few data from particular DB. i.e. From
Client side if I enter the user name, Server side will fetch the data
from DB and it will return back to client using SOAPpy. Here both the
Server side and Client side scripts are python files. In real time our
clients should be able to access our methods from any application,
like VC++ or .NET etc. How would we ensure that this webservice will
work for all environments?

It would also be great if you guide me to configure my web address
(For Ex: http://localhost:8080) in apache.


Thanks!
~Vela

On Mar 1, 4:52 pm, velappan velappan <velapp...@gmail.com> wrote:
> Hi Kelvin,
>
> Thanks for your information will have look on those things. But we
> have not used Django. We will try to do if it suits for us. Thanks
> once again for your information  all. Will work on those stuffs and
> keep this post updated :)
>
> Thanks & regards
> Vela
>
> On Feb 28, 9:42 pm, Kevin Noonan <knoo...@gmail.com> wrote:
>
> > Hi Vela,
>
> > If you're following one of the articles and using Google App Engine,
> > you'll be leaving your Apache, your current server hosting and
> > database behind and adopting Google's infrastructure--in that case,
> > see the docs athttp://appengine.google.comtoget going.

Michael Thompson

unread,
Mar 5, 2009, 3:59:47 AM3/5/09
to python...@googlegroups.com
2009/3/5 velappan velappan <vela...@gmail.com>:

>
> It would also be great if you guide me to configure my web address
> (For Ex: http://localhost:8080) in apache.

You can setup apache to run files that end in .py as cgi scripts but
there is a big overhead in starting the python interpreter every time
a page is requested. This can be overcome by using mod_python or
fastcgi, Django for instance has support for both of these methods and
might be simpler than writing your own mod_python handler.

If you're deploying to shared hosting this might also affect what you pick.

Michael

Kevin Noonan

unread,
Mar 5, 2009, 5:28:03 PM3/5/09
to python...@googlegroups.com
Hi Vela,

> ...our clients should be able to access our methods from any application,


> like VC++ or .NET etc. How would we ensure that this webservice will
> work for all environments?

Testing. Lots of testing. Write once, test everywhere!

Good luck,

Kevin.

Reply all
Reply to author
Forward
0 new messages