SOAP Server with WSDL?

Discussion in 'Python' started by tobiah, Dec 7, 2006.

  1. tobiah

    tobiah Guest

    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

    --
    Posted via a free Usenet account from http://www.teranews.com
     
    tobiah, Dec 7, 2006
    #1
    1. Advertising

  2. On Thu, Dec 07, 2006 at 12:49:09PM -0800, tobiah wrote:
    > 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.

    > 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?

    You only need ZSI.
    >
    > Thanks,
    >
    > Toby
    >
    > --
    > Posted via a free Usenet account from http://www.teranews.com
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
     
    Chris Lambacher, Dec 7, 2006
    #2
    1. Advertising

  3. tobiah

    tobiah Guest


    > 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

    --
    Posted via a free Usenet account from http://www.teranews.com
     
    tobiah, Dec 7, 2006
    #3
  4. tobiah

    Guest

    On 7 dic, 18:52, tobiah <> wrote:

    > 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...

    --
    Gabriel Genellina
     
    , Dec 7, 2006
    #4
  5. On Thu, Dec 07, 2006 at 01:52:59PM -0800, tobiah wrote:
    >
    > > 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.

    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.

    >
    > Thanks,
    >
    > Toby
    >
    > --
    > Posted via a free Usenet account from http://www.teranews.com
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
     
    Chris Lambacher, Dec 7, 2006
    #5
  6. >> 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.

    >> 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.


    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
     
    Diez B. Roggisch, Dec 7, 2006
    #6
  7. tobiah

    Ravi Teja Guest

    tobiah wrote:
    > 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.
     
    Ravi Teja, Dec 8, 2006
    #7
  8. tobiah

    vasudevram Guest

    Ravi Teja wrote:
    > tobiah wrote:
    > > 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.
     
    vasudevram, Dec 8, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Bedford
    Replies:
    0
    Views:
    608
    Chris Bedford
    Aug 21, 2003
  2. Lonnie Princehouse

    SOAP server with WSDL?

    Lonnie Princehouse, Apr 24, 2006, in forum: Python
    Replies:
    0
    Views:
    342
    Lonnie Princehouse
    Apr 24, 2006
  3. Patrick Hurley

    SOAP Server WSDL generation

    Patrick Hurley, Mar 29, 2005, in forum: Ruby
    Replies:
    1
    Views:
    199
    leon breedt
    Mar 30, 2005
  4. ashgromnies
    Replies:
    0
    Views:
    202
    ashgromnies
    Apr 24, 2006
  5. Me
    Replies:
    2
    Views:
    468
Loading...

Share This Page