1: soaplib work as client is incomplete. A good choice for webservice client is suds.
2: "Currently, the only advantage of using rpclib as a soap client is its speed and if you need speed that bad, you should not be using soap (or xml) anyway.",
do you mean that soap is slow and we did nothing about it.
part 2:
"Does this answer your question, or is there any more", In fact, i want to know why sometimes suds throws a stack of exceptions when invoke soaplib sever. I have to admire most of time it's okay and wastes longer time.
The details is reported in problem 2 of my mail.
part 3: Do you have some experience about Java Axis2?
I developed a webservice server-side using tornadows(tornadow webservice.Besides soaplib, tornadows is the best server-side I have meet). I use suds-client invoke tornadows-server successfully. While, if i use Java Axis2 invoke it, nothing happened and the request nearly not reach the server.
In actual fact, how to invoke a webservice server-side successfully is my true question. What I need is provide a python webservice server-side which can be invoked by Java Axis2. This is why i try to find a good webservice server-side, including soaplib.
If you need a soap client, just use suds and don't bother with
rpclib/soaplib. It's just incomplete. Currently, the only advantage
of using rpclib as a soap client is its speed and if you need speed
that bad, you should not be using soap (or xml) anyway.
Does this answer your question, or is there any more questions
hidden in the heap below?
best,
burak
On 12/06/11 16:03, 贾晓磊 wrote:
Hi, all:
Recently, I have been do something about python webservice.
Above all the methods of python webservice, soaplib is welcome
and popular. When using soaplib, some problems puzzled me as
follows.
porlbem 1: soaplib provide client-side or not?
Usually, I use soaplib as follows:
# file-name: soaplib_server.py:
# -*- coding:utf-8 -*-
from soaplib.wsgi_soap import SimpleWSGISoapApp
from soaplib.service import soapmethod
from soaplib.serializers.clazz import ClassSerializer
from soaplib.serializers.primitive import String, Integer,
Array, DateTime
"Soaplib is an easy to use Python library for publishing SOAP
web services using WSDL 1.1 standard, and answering SOAP 1.1
requests. With a very small amount of code, soaplib allows you
to write a useful web service and deploy it as a WSGI
application. (Non-WSGI scenarios are also supported.)"
Most of scenes, soaplib make as server and suds did for
client. They can work together well.
In a web page, I found someone use client by soaplib, the
client can be write as follows:
# file-name: soaplib_client.py
# -*- coding:utf-8 -*-
from soaplib_server3 import SMSService
from soaplib_server3 import make_client
import lxml.etree as et
a = make_client()
ret = a.get_sms('jia')
print 'ret:', ret
print 'type of ret:', type(ret)
for i,r in enumerate(ret):
print 'i:',i, r.mobile, r.content
#output:
ret: [<soaplib_server3.SMS object at 0x8ecf7ec>]
type of ret: <type 'list'>
i: 0 13011292217 hi, it's a test!
#NOTE: now, the questions are :
1: Whether soaplib can provide client?
2: If the answer for question 1 is okay, then the second
question is : how to provide a webservice client using soaplib?
Is the method "client =
make_service_client('http://localhost:7789/'
,SMSService())" which is be used in my
soaplib_serve.py?
3: if you agree that soaplib can make as websevice
client-side, I would like to ask: The client relays so heavily
on sever-side, in the client-side, it requests some classes or
modules in server side are imported. If we use soaplib-client to
invoke a remote server(it may be developed in Java, C#, php or
other language, or python which is not in the some local), how
we get the class in server?
I do not whether i speak my question clearly. In actual fact,
what I eager to know is how to provide a client-side using
soaplib if soaplib can.
part 2: Is there someone find it spend much time and not
stable to invoke soaplib using suds as follows.