SOAP Server with WSDL?

T

tobiah

I'm having trouble finding information
about writing a SOAP server. I get the client
part. There is much information about writing
a client, but not so much about writing the server.
Are there some good tutorials?

I'm checking out:

http://pywebsvcs.sourceforge.net/

But I'm a little confused. Do I want ZSI or SOAPY?
The site says:

SOAPpy: A second web services toolkit which is getting
functionally integrated into the ZSI toolkit. In the
future, the Python Web Services Project will only support
one merged web services toolkit, under the ZSI name.

This make me think that I will use ZSI in the future,
but what about now? Do I need both now?

Thanks,

Toby
 
C

Chris Lambacher

I'm having trouble finding information
about writing a SOAP server. I get the client
part. There is much information about writing
a client, but not so much about writing the server.
Are there some good tutorials?

I'm checking out:

http://pywebsvcs.sourceforge.net/

But I'm a little confused. Do I want ZSI or SOAPY?
You want ZSI. If you already have a wsdl you then use wsdl2py and
wsdl2dispatch to create your server classes. The server classes get used
with ZSI.ServiceContainer. Unfortunately there is not much documentation
about this. I figured it out by playing with the tests that ship with ZSI.

You might also want to check out ZSI the mailing list/archives which you can
get to from the above link.
 
T

tobiah

You want ZSI. If you already have a wsdl you then use wsdl2py and
wsdl2dispatch to create your server classes. The server classes get used
with ZSI.ServiceContainer. Unfortunately there is not much documentation
about this.

Actually, do I have to make a WSDL? Do people hand write these, or
are there tools? I don't really need to publish an interface. I just
want some in house apps to communicate.

I can't figure out if I want SOAP, or CORBA, or would it just be
easier if I just starting opening sockets and firing data around
directly. Ideally, I'd like to share complex objects. That's why
I thought that I needed one of the above standards.

I'm confused by it all. Am I even looking in the right direction?

Thanks,

Toby
 
G

gagsl-py

Actually, do I have to make a WSDL? Do people hand write these, or
are there tools? I don't really need to publish an interface. I just
want some in house apps to communicate.

I can't figure out if I want SOAP, or CORBA, or would it just be
easier if I just starting opening sockets and firing data around
directly. Ideally, I'd like to share complex objects. That's why
I thought that I needed one of the above standards.

A few alternatives:

xml-rpc
Pros: multiplatform, multilanguage, standard, available in python std
lib, very simple to use
Cons: simple function calls only, limited argument types, no objects as
argument

Pyro <http://pyro.sourceforge.net/>
Pros: object based, multiplatform, full python language support
(argument list, keyword arguments...)
Cons: only Python supported, non standard

CORBA is a big beast and if you don't actually need it, don't use it...
 
C

Chris Lambacher

Actually, do I have to make a WSDL? Do people hand write these, or
are there tools? I don't really need to publish an interface. I just
want some in house apps to communicate.
If you can help it you don't write WSDL by hand. You don't even have to make a
WSDL, but it is convenient for describing interface and you can use things
like wsdl2py, wsdl2java, etc. to create the majority of the boiler plate parts
of the client/server code for you.
I can't figure out if I want SOAP, or CORBA, or would it just be
Unless you are talking to an existing CORBA interface, don't go there.
easier if I just starting opening sockets and firing data around
directly. Ideally, I'd like to share complex objects. That's why
I thought that I needed one of the above standards.

I'm confused by it all. Am I even looking in the right direction?
Define complex objects. Is all your code in Python? Will it stay that way?
Are the running client and server versions always going to be in sync?

Depending on how complex, 'complex objects' are, You might be better off with
a XML-RPC, it is far less complicated, but since I don't really know what
problem you are trying to solve it is a little hard to make a definitive
recommendation.

Protocol definition is a tricky thing to get right without a lot of
experience. Picking an existing standard my help with your own sanity.
Note that to some extent you can pick and choose standards. For instance you
can use http as your transport using the URL as a method of defining where the
data goes. The data can be encoded in any one of a number of formats
including XML, JSON and pickle. If you happen to choose http and XML, you get
what is known as REST. Who/what you need to talk to and how complicated your
data is will dictate what subset of these you can use. Pick something that
will be easy to handle on both ends of the connection, i.e. if one end has to
be in C, make sure there is a library for it and take pickle out of your list
of options.
 
D

Diez B. Roggisch

I can't figure out if I want SOAP, or CORBA, or would it just be
Unless you are talking to an existing CORBA interface, don't go there.

Can't agree to that. CORBA is by far better than SOAP. And writing an
IDL is actually a easy and straightforward thing to do - no tools
needed, as when writing WSDL. With omniORB there is a easy to use,
powerful and actively devloped ORB for python available.

The only thing that makes it complicated is life-cycle-management. You
don't get that for free. But then, it's a hard thing to do anyway in a
distributed evnvironment.

If all is python, use Pyro. If you need interoperability, and want
OO-style interfaces, use CORBA.

Steer clear from SOAP if you can. See

http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple

for more good reasons to avoid it at all cast than I can list here myself.

So if it must be XML, use XMLRPC. After all, you can marshal anything
over it if only you serialize dictionaries somehow - then the rest will
follow.


Diez
 
R

Ravi Teja

tobiah said:
Actually, do I have to make a WSDL? Do people hand write these, or
are there tools? I don't really need to publish an interface. I just
want some in house apps to communicate.

Java and .NET based tools can auto-generate WSDL from code. Python does
not have such because function definitions do not contain the type
information required for such a tool. However , you can grab a free
Java (Netbeans with Enterprise pack) or .NET (Visual Studio Express)
IDE (or just the respective SDK if you don't mind reading through the
docs), create a stub function, mark it as a WebMethod, let it generate
the WSDL and pass it to wsdl2py that comes with ZSI. This is a twisted
approach.

But you state that you don't need to publish an interface. If that is
the case, it can be as simple as this.

import SOAPpy
def hello():
return "Hello World"

server = SOAP.SOAPServer(("localhost", 8080))
server.registerFunction(hello)
server.serve_forever()

Pasted from
http://pywebsvcs.sourceforge.net/soappy.txt
I can't figure out if I want SOAP, or CORBA, or would it just be
easier if I just starting opening sockets and firing data around
directly. Ideally, I'd like to share complex objects. That's why
I thought that I needed one of the above standards.

I posted a few days ago a simple guide to choosing a remoting
framework.
http://groups.google.com/group/comp...ebraviteja&rnum=4&hl=en&#doc_3f056c5c87279aca

For *complex* objects, you need a stateful remoting mechanism. The
choice is Pyro if both the server and all the clients are written in
Python. Else, use CORBA or ICE with DMI. All of these are simple to use
for simple remote object invocations although distributed computing in
general does have a learning curve.

Ravi Teja.
 
V

vasudevram

Ravi said:
Java and .NET based tools can auto-generate WSDL from code. Python does
not have such because function definitions do not contain the type
information required for such a tool. However , you can grab a free
Java (Netbeans with Enterprise pack) or .NET (Visual Studio Express)
IDE (or just the respective SDK if you don't mind reading through the
docs), create a stub function, mark it as a WebMethod, let it generate
the WSDL and pass it to wsdl2py that comes with ZSI. This is a twisted
approach.

But you state that you don't need to publish an interface. If that is
the case, it can be as simple as this.

import SOAPpy
def hello():
return "Hello World"

server = SOAP.SOAPServer(("localhost", 8080))
server.registerFunction(hello)
server.serve_forever()

Pasted from
http://pywebsvcs.sourceforge.net/soappy.txt


I posted a few days ago a simple guide to choosing a remoting
framework.
http://groups.google.com/group/comp...ebraviteja&rnum=4&hl=en&#doc_3f056c5c87279aca

For *complex* objects, you need a stateful remoting mechanism. The
choice is Pyro if both the server and all the clients are written in
Python. Else, use CORBA or ICE with DMI. All of these are simple to use
for simple remote object invocations although distributed computing in
general does have a learning curve.

Ravi Teja.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top