From glauco.uri at prometeia.it Wed Nov 2 18:31:24 2011 From: glauco.uri at prometeia.it (Glauco) Date: Wed, 02 Nov 2011 18:31:24 +0100 Subject: [Soap-Python] https - trust certificate Message-ID: <4EB17E6C.2080203@prometeia.it> Hi all, i'm tryind to use pysimplesoap as client. When i try to connect to this WSDL: *http://tinyurl.com/6jjgbtr* i receive alwais this error: *** SSLHandshakeError: [Errno 1] _ssl.c:480: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Is not quite clear to me how to solve this. I've worked a lot over this issue and i think client don't handle correctly certificate. Am i wrong? Thank you Gla Il contenuto di questa e-mail ? rivolto unicamente alle persone alle quali ? indirizzato e pu? contenere informazioni la cui riservatezza ? tutelata legalmente. Sono vietati la riproduzione, la diffusione e l?uso di questa e-mail in mancanza di autorizzazione del destinatario. Se avete ricevuto questa e-mail per errore vogliate cortesemente contattarci immediatamente. This e-mail is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorised reproduction, dissemination or use of this e-mail or of the information herein by anyone other than the intended recipient is prohibited. If you have received this e-mail by mistake, please notify us immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Fri Nov 4 15:42:15 2011 From: dieter at handshake.de (Dieter Maurer) Date: Fri, 4 Nov 2011 15:42:15 +0100 Subject: [Soap-Python] https - trust certificate In-Reply-To: <4EB17E6C.2080203@prometeia.it> References: <4EB17E6C.2080203@prometeia.it> Message-ID: <20147.63943.511364.183556@localhost.localdomain> Glauco wrote at 2011-11-2 18:31 +0100: >Hi all, i'm tryind to use pysimplesoap as client. > >When i try to connect to this WSDL: >*http://tinyurl.com/6jjgbtr* > > >i receive alwais this error: >*** SSLHandshakeError: [Errno 1] _ssl.c:480: error:14090086:SSL >routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed > >Is not quite clear to me how to solve this. >I've worked a lot over this issue and i think client don't handle >correctly certificate. > >Am i wrong? You are likely right. To handle certificates correctly, the ssl library must learn about a set of trusted certificates and any given certificate must finally (potentially via a chain of certificate verifications) be certified by one of the trusted certificates. Check the relevant documentation (of "pysimplesoap" and Python's "_ssl" module) how you can provide those trusted certificates. If necessary, look at "pysimplesoaap" source (it seems to do something special because at least in older Python versions, there has been no certificate verification by default). Ensure that the certificate presented by the server allows verification by one of your trusted certificates. -- Dieter From me at stepank.name Wed Nov 9 12:34:14 2011 From: me at stepank.name (=?KOI8-R?B?89TF0MHOIOvP0s7Ry8/X?=) Date: Wed, 9 Nov 2011 15:34:14 +0400 Subject: [Soap-Python] Introducing pyws Message-ID: Hello, Everybody! Those of you who follow the news about new packages on PyPI might have noticed the recent appearance of a new library for creating SOAP servers, it is called pyws and I'm its developer. I would like to introduce it in this mailing list - https://github.com/stepank/pyws . The main idea is to let developers completely forget about SOAP itself and make creating of APIs fast and painless. I've finnaly released (under MIT) the first stable version 1.0, documentation can be found at http://stepank.github.com/pyws/1.0/index.html , the package is available for download and install at PyPI - http://pypi.python.org/pypi/pyws . Common features: - a web framework agnostic server, - an adapter for Django, - protocols: SOAP 1.1, REST, JSON, - context handling & authentication framework, - a simple types description system. SOAP specific features: - request, response, exceptions, - automatic generation of WSDL 1.1 service description, including headers and exceptions, - simple types handling: integer, float, string, date, datetime, - complex types handling: dict, list (nested structures of any depth are allowed), - integration tests: PHP, Java (Axis 1.4), Python (suds), WS-I Basic Profile 1.2. Any comments, suggestions etc would be of great value, so feel free to contact me via e-mail stepankk at gmail.com. I hope this library will be helpful for developers and am going to develop it further to make it better. I am subsribed to soap at python.org and would like to participate in any discussion concerning pyws. Best regards, Stepan Kornyakov. From cdevienne at gmail.com Wed Nov 9 12:54:08 2011 From: cdevienne at gmail.com (Christophe de Vienne) Date: Wed, 09 Nov 2011 12:54:08 +0100 Subject: [Soap-Python] Introducing pyws In-Reply-To: References: Message-ID: <4EBA69E0.5070308@gmail.com> Kind of similar to wsme (http://packages.python.org/WSME/) which I released a few weeks ago. I will have a look ^^ Cheers, Christophe Le 09/11/2011 12:34, ?????? ???????? a ?crit : > Hello, Everybody! > > Those of you who follow the news about new packages on PyPI might have > noticed the recent appearance of a new library for creating SOAP > servers, it is called pyws and I'm its developer. I would like to > introduce it in this mailing list - https://github.com/stepank/pyws . > The main idea is to let developers completely forget about SOAP itself > and make creating of APIs fast and painless. > > I've finnaly released (under MIT) the first stable version 1.0, > documentation can be found at > http://stepank.github.com/pyws/1.0/index.html , the package is > available for download and install at PyPI - > http://pypi.python.org/pypi/pyws . > > Common features: > - a web framework agnostic server, > - an adapter for Django, > - protocols: SOAP 1.1, REST, JSON, > - context handling & authentication framework, > - a simple types description system. > > SOAP specific features: > - request, response, exceptions, > - automatic generation of WSDL 1.1 service description, including > headers and exceptions, > - simple types handling: integer, float, string, date, datetime, > - complex types handling: dict, list (nested structures of any depth > are allowed), > - integration tests: PHP, Java (Axis 1.4), Python (suds), WS-I Basic > Profile 1.2. > > Any comments, suggestions etc would be of great value, so feel free to > contact me via e-mail stepankk at gmail.com. I hope this library will be > helpful for developers and am going to develop it further to make it > better. I am subsribed to soap at python.org and would like to > participate in any discussion concerning pyws. > > Best regards, Stepan Kornyakov. > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Sun Nov 13 13:36:58 2011 From: azurit at pobox.sk (azurIt) Date: Sun, 13 Nov 2011 13:36:58 +0100 Subject: [Soap-Python] rpclib - NULL values Message-ID: <20111113133658.7B7737E5@pobox.sk> Hi, i'm having little problems with NULL values send via rpclib server. It looks like that rpclib is sending this results: empty string = empty element (resolved to None by suds) None = sends no element at all (suds will NOT include this in result) I believe that suds behavior is correct because: 1.) i think that most clients will ignore missing elements and will not include them in parsed result 2.) suds cannot return empty strings [=empty elements in current rpclib behavior] (it will resolve them to None) but it's not a big deal at all - empty strings are almost the same as None. this problem applies _only_ to strings 3.) it's not possible to send empty elements for all other simple types cos, for example integers, simply cannot be empty (only strings can be empty). logically, empty elements for all except strings really _should_ be resolved to None. I think that rpclib should change this behavior and resolve None to empty element in all cases. Burak, what do you think ? azur From burak.arslan at arskom.com.tr Sun Nov 13 18:13:18 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 13 Nov 2011 19:13:18 +0200 Subject: [Soap-Python] rpclib - NULL values In-Reply-To: <20111113133658.7B7737E5@pobox.sk> References: <20111113133658.7B7737E5@pobox.sk> Message-ID: <4EBFFAAE.7000403@arskom.com.tr> On 13.11.2011 14:36, azurIt wrote: > Hi, > > i'm having little problems with NULL values send via rpclib server. It looks like that rpclib is sending this results: > empty string = empty element (resolved to None by suds) > None = sends no element at all (suds will NOT include this in result) > > I believe that suds behavior is correct because: > 1.) i think that most clients will ignore missing elements and will not include them in parsed result > 2.) suds cannot return empty strings [=empty elements in current rpclib behavior] (it will resolve them to None) but it's not a big deal at all - empty strings are almost the same as None. this problem applies _only_ to strings > 3.) it's not possible to send empty elements for all other simple types cos, for example integers, simply cannot be empty (only strings can be empty). logically, empty elements for all except strings really _should_ be resolved to None. > > I think that rpclib should change this behavior and resolve None to empty element in all cases. Burak, what do you think ? if you add min_occurs=1 to the responses, rpclib will return null values instead of omitting them. let me know if this is not the case. burak > azur > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Sun Nov 13 20:06:13 2011 From: azurit at pobox.sk (azurIt) Date: Sun, 13 Nov 2011 20:06:13 +0100 Subject: [Soap-Python] rpclib - NULL values In-Reply-To: <4EBFFAAE.7000403@arskom.com.tr> References: <20111113133658.7B7737E5@pobox.sk> <4EBFFAAE.7000403@arskom.com.tr> Message-ID: <20111113200613.717EB104@pobox.sk> ______________________________________________________________ >> empty string = empty element (resolved to None by suds) >> None = sends no element at all (suds will NOT include this in result) >> >> I believe that suds behavior is correct because: >> 1.) i think that most clients will ignore missing elements and will not include them in parsed result >> 2.) suds cannot return empty strings [=empty elements in current rpclib behavior] (it will resolve them to None) but it's not a big deal at all - empty strings are almost the same as None. this problem applies _only_ to strings >> 3.) it's not possible to send empty elements for all other simple types cos, for example integers, simply cannot be empty (only strings can be empty). logically, empty elements for all except strings really _should_ be resolved to None. >> >> I think that rpclib should change this behavior and resolve None to empty element in all cases. Burak, what do you think ? > >if you add min_occurs=1 to the responses, rpclib will return null values >instead of omitting them. let me know if this is not the case. this does the trick, thnx! > >burak > >> azur >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From rj-soaplib at sysgroup.fr Tue Nov 15 21:06:20 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Tue, 15 Nov 2011 21:06:20 +0100 Subject: [Soap-Python] soaplib on OpenVMS Message-ID: <4EC2C63C.60703@sysgroup.fr> An article from the OpenVMS technical journal "Accessing RMS indexed files from non-VMS systems using SOAP and Python" http://www.openvms.compaq.com/openvms/journal/index.html#python which describes how to use soaplib on OpenVMS to access RMS indexed files from other systems. Enjoy. From jpdv at quantsolutions.co.za Tue Nov 22 08:21:28 2011 From: jpdv at quantsolutions.co.za (Jean-Pierre De Villiers) Date: Tue, 22 Nov 2011 09:21:28 +0200 Subject: [Soap-Python] Exception in soap call Message-ID: Hi there, I would like to know if anyone has come across this error: Exception in soap call Opening and ending tag mismatch: p line 24 and body, line 28, column 8 I can't seem to find the problem so any help fixing this would be a huge help. Regards, JP -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Tue Nov 22 08:23:41 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 22 Nov 2011 09:23:41 +0200 Subject: [Soap-Python] Exception in soap call In-Reply-To: References: Message-ID: <4ECB4DFD.2040502@arskom.com.tr> On 11/22/11 09:21, Jean-Pierre De Villiers wrote: > Hi there, > > I would like to know if anyone has come across this error: > > Exception in soap call Opening and ending tag mismatch: p line 24 and > body, line 28, column 8 > > I can't seem to find the problem so any help fixing this would be a > huge help. > the xml document you send to your soap server is invalid. revise your request generator or use a proper soap client. best, burak From rj-soaplib at sysgroup.fr Tue Nov 22 09:41:02 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Tue, 22 Nov 2011 09:41:02 +0100 Subject: [Soap-Python] Article about soaplib and OpenVMS Message-ID: <4ECB601E.2040304@sysgroup.fr> Hello, In the last OpenVMS technical journal (V17), I've written an article about how to access OpenVMS indexed files using SOAP services with Python and soaplib. http://www.openvms.compaq.com/openvms/journal/index.html#python Enjoy. From jiaxiaolei19871112 at gmail.com Fri Nov 25 05:53:42 2011 From: jiaxiaolei19871112 at gmail.com (=?UTF-8?B?6LS+5pmT56OK?=) Date: Fri, 25 Nov 2011 12:53:42 +0800 Subject: [Soap-Python] Exception in soap call In-Reply-To: References: Message-ID: hi, all: ask for help. first of all, i will admire i am a novice to soap. using some helps from documents and blog, i set up some server-client successfully, while some are failed. when use a remote webservice as follow, it failed, please someone can give a help... >>> from SOAPpy import WSDL >>> url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" >>> server = WSDL.Proxy(url) /usr/lib/pymodules/python2.6/SOAPpy/wstools/XMLSchema.py:2871: DeprecationWarning: object.__init__() takes no parameters tuple.__init__(self, args) >>> server = WSDL.Proxy(url) >>> server.methods.keys() [u'sendMo', u'syncResponseRpt', u'sendMt', u'syncStaff', u'syncCorp'] >>> server.methods['sendMt'] >>> server.methods['sendMt'].inparams [] >>> server.methods['sendMt'].inparams[0].type (u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string') >>> server.methods['sendMt'].inparams[0].name u'mtInfo' >>> server.methods['sendMt'].outparams[0].name u'sendMtReturn' >>> server.methods['sendMt'].outparams[0].type (u'http://schemas.xmlsoap.org/soap/encoding/', u'string') >>> server.sendMt(['a','b']) Traceback (most recent call last): File "", line 1, in File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in __call__ return self.__r_call(*args, **kw) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in __r_call self.__hd, self.__ma) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __call raise p SOAPpy.Types.faultType: : {'fault': : {'text': 'SoapHeader is null', 'messageId': 'SEV_0003'}, 'exceptionName': 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': 'ln_xxt_mh01'}> #NOTE: 1: the url " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" is okay? you can have a test! 2: the inparams: >>> server.methods['sendMt'].inparams[0].type (u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string') in java program language, it just means String[], ie, a array with items of String. in my view, in python , it can be replaced by ['a','b','c'] or ('a','b','c'), ie, a list or tuple 3: i am a chinese, and the first time to ask question in the maillist, so point the unfits or mistakes casually. -- jia xiaolei -------------- next part -------------- An HTML attachment was scrubbed... URL: From vsza at vsza.hu Fri Nov 25 19:36:35 2011 From: vsza at vsza.hu (Veres-Szentkiralyi Andras) Date: Fri, 25 Nov 2011 19:36:35 +0100 Subject: [Soap-Python] Exception in soap call In-Reply-To: References: Message-ID: <201111251936.35661.vsza@vsza.hu> As I'm not a SOAPpy expert, I'd address the problem on another level: why don't you try SUDS? I'm not familiar with the service you're using, but it seemed to me, that SUDS is capable of sending your sample request. >>> from suds.client import Client >>> c = Client("http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl") >>> c.service.sendMt(['a','b']) You can fetch SUDS either from its homepage (https://fedorahosted.org/suds/), or using easy_install. If you run into problems while using SUDS, you can either try here, or on the SUDS mailing list: https://lists.fedoraproject.org/mailman/listinfo/suds Regards, Andr?s Veres-Szentkir?lyi 2011. november 25. p?ntek 05:53:42 d?tummal ??? ezt ?rta: > hi, all: > > ask for help. > > first of all, i will admire i am a novice to soap. > using some helps from documents and blog, i set up some server-client > successfully, while some are failed. > > when use a remote webservice as follow, it failed, please someone can give > a help... > > >>> from SOAPpy import WSDL > >>> url = " > > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" > > >>> server = WSDL.Proxy(url) > > /usr/lib/pymodules/python2.6/SOAPpy/wstools/XMLSchema.py:2871: > DeprecationWarning: object.__init__() takes no parameters > tuple.__init__(self, args) > > >>> server = WSDL.Proxy(url) > >>> server.methods.keys() > > [u'sendMo', u'syncResponseRpt', u'sendMt', u'syncStaff', u'syncCorp'] > > >>> server.methods['sendMt'] > > > > >>> server.methods['sendMt'].inparams > > [] > > >>> server.methods['sendMt'].inparams[0].type > > (u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string') > > >>> server.methods['sendMt'].inparams[0].name > > u'mtInfo' > > >>> server.methods['sendMt'].outparams[0].name > > u'sendMtReturn' > > >>> server.methods['sendMt'].outparams[0].type > > (u'http://schemas.xmlsoap.org/soap/encoding/', u'string') > > >>> server.sendMt(['a','b']) > > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in > __call__ > return self.__r_call(*args, **kw) > File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in > __r_call > self.__hd, self.__ma) > File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __call > raise p > SOAPpy.Types.faultType: : {'fault': > : {'text': 'SoapHeader is > null', 'messageId': 'SEV_0003'}, 'exceptionName': > 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': > 'ln_xxt_mh01'}> > > #NOTE: > 1: the url " > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" > is okay? you can have a test! > > 2: the inparams: > >>> server.methods['sendMt'].inparams[0].type > > (u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string') > > in java program language, it just means String[], ie, a array with items of > String. > in my view, in python , it can be replaced by ['a','b','c'] or > ('a','b','c'), ie, a list or tuple > 3: i am a chinese, and the first time to ask question in the maillist, so > point the unfits or mistakes casually. > > -- jia xiaolei From jiaxiaolei19871112 at gmail.com Fri Nov 25 23:34:31 2011 From: jiaxiaolei19871112 at gmail.com (=?UTF-8?B?6LS+5pmT56OK?=) Date: Sat, 26 Nov 2011 06:34:31 +0800 Subject: [Soap-Python] Exception in soap call In-Reply-To: <201111251936.35661.vsza@vsza.hu> References: <201111251936.35661.vsza@vsza.hu> Message-ID: thanks, i will try it later. thanks! -- jiaxiaolei On Sat, Nov 26, 2011 at 2:36 AM, Veres-Szentkiralyi Andras wrote: > As I'm not a SOAPpy expert, I'd address the problem on another level: > why don't you try SUDS? I'm not familiar with the service you're using, > but it seemed to me, that SUDS is capable of sending your sample request. > > >>> from suds.client import Client > >>> c = > Client(" > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl > ") > >>> c.service.sendMt(['a','b']) > > You can fetch SUDS either from its homepage ( > https://fedorahosted.org/suds/), > or using easy_install. If you run into problems while using SUDS, you can > either try here, or on the SUDS mailing list: > https://lists.fedoraproject.org/mailman/listinfo/suds > > Regards, > Andr?s Veres-Szentkir?lyi > > 2011. november 25. p?ntek 05:53:42 d?tummal ??? ezt ?rta: > > hi, all: > > > > ask for help. > > > > first of all, i will admire i am a novice to soap. > > using some helps from documents and blog, i set up some server-client > > successfully, while some are failed. > > > > when use a remote webservice as follow, it failed, please someone can > give > > a help... > > > > >>> from SOAPpy import WSDL > > >>> url = " > > > > > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl > " > > > > >>> server = WSDL.Proxy(url) > > > > /usr/lib/pymodules/python2.6/SOAPpy/wstools/XMLSchema.py:2871: > > DeprecationWarning: object.__init__() takes no parameters > > tuple.__init__(self, args) > > > > >>> server = WSDL.Proxy(url) > > >>> server.methods.keys() > > > > [u'sendMo', u'syncResponseRpt', u'sendMt', u'syncStaff', u'syncCorp'] > > > > >>> server.methods['sendMt'] > > > > > > > > >>> server.methods['sendMt'].inparams > > > > [] > > > > >>> server.methods['sendMt'].inparams[0].type > > > > (u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string') > > > > >>> server.methods['sendMt'].inparams[0].name > > > > u'mtInfo' > > > > >>> server.methods['sendMt'].outparams[0].name > > > > u'sendMtReturn' > > > > >>> server.methods['sendMt'].outparams[0].type > > > > (u'http://schemas.xmlsoap.org/soap/encoding/', u'string') > > > > >>> server.sendMt(['a','b']) > > > > Traceback (most recent call last): > > File "", line 1, in > > File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in > > __call__ > > return self.__r_call(*args, **kw) > > File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in > > __r_call > > self.__hd, self.__ma) > > File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in > __call > > raise p > > SOAPpy.Types.faultType: > : {'fault': > > : {'text': 'SoapHeader is > > null', 'messageId': 'SEV_0003'}, 'exceptionName': > > 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': > > 'ln_xxt_mh01'}> > > > > #NOTE: > > 1: the url " > > > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl > " > > is okay? you can have a test! > > > > 2: the inparams: > > >>> server.methods['sendMt'].inparams[0].type > > > > (u'service.global.v1_0.wsdl.protocol.xxt', u'ArrayOf_soapenc_string') > > > > in java program language, it just means String[], ie, a array with items > of > > String. > > in my view, in python , it can be replaced by ['a','b','c'] or > > ('a','b','c'), ie, a list or tuple > > 3: i am a chinese, and the first time to ask question in the maillist, so > > point the unfits or mistakes casually. > > > > -- jia xiaolei > -- NAME: ???/Jia Xiaolei MOBILE: 13011292217 QQ: 281304051 MICRO-BLOG: http://weibo.com/2183890715 GMAIL: jiaxiaolei19871112 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jiaxiaolei19871112 at gmail.com Tue Nov 29 04:04:47 2011 From: jiaxiaolei19871112 at gmail.com (=?UTF-8?B?6LS+5pmT56OK?=) Date: Tue, 29 Nov 2011 11:04:47 +0800 Subject: [Soap-Python] SOAPpy and WSDLs with nested urns... In-Reply-To: References: Message-ID: Hi, all: First of all, I will admire I am a novice to web service. What I need now is to invoke a method sendMt provided by the web service server(prehaps the server is made by java language using a framwork named Axis). I try to invoke the sendMt method provided by the server, then failded. There are the tests as follows: method 1: import suds def test_sms(): #TODO: it's failed url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" #client = suds.client.Client(url,faults=False) client = suds.client.Client(url) print 'client', client a = ['jia','xiao'] output = client.service.sendMt(a) print 'output', output # the output: client Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: R580-20091016 Service ( LNXxtSyncServiceService ) tns="service.global.v1_0.wsdl.protocol.xxt" Prefixes (3) ns0 = "http://common.v1_0.obj.protocol.xxt" ns1 = "http://schemas.xmlsoap.org/soap/encoding/" ns2 = "service.global.v1_0.wsdl.protocol.xxt" Ports (1): (LNXxtSyncService) Methods (5): sendMo(ArrayOf_soapenc_string moInfo, ) sendMt(ArrayOf_soapenc_string mtInfo, ) syncCorp(ArrayOf_tns2_GroupOrderInfo orderInfo, ) syncResponseRpt(ArrayOf_soapenc_string rpt, ) syncStaff(ArrayOf_tns2_UserOrderInfo orderInfo, ) Types (54): ns1:Array ArrayOf_soapenc_string ArrayOf_tns2_GroupOrderInfo ArrayOf_tns2_UserOrderInfo ns1:ENTITIES ns1:ENTITY ... No handlers could be found for logger "suds.client" Traceback (most recent call last): File "suds_client.py", line 124, in test_sms2() File "suds_client.py", line 99, in test_sms2 output = client.service.sendMt(a) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 535, in __call__ return client.invoke(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 595, in invoke result = self.send(msg) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 630, in send result = self.failed(binding, e) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 681, in failed r, p = binding.get_fault(reply) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/bindings/binding.py", line 235, in get_fault raise WebFault(p, faultroot) suds.WebFault: Server raised fault: 'No such operation 'sendMt'' #Note: 1: the url " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" is develped in Internet, anyone can use it. 2: in my view, the server is made by java Axis, and the inparams of sendmt is ArrayOf_soapenc_string(In java, it means a array of String, in python, it means a list whose items are string). 3: the problem has puzzled me for nearly a week, please someone can give me some points. # besides the suds, i try other methods as follows, whlie, still failed. method 2: from SOAPpy import SOAPProxy def test_sms(): """test for ln sms java webservice """ #TODO:invoke sms is stil failed url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService" server = SOAPProxy(url) args = ['jia','xiao'] print server.sendMt(args) # output: w_jiaxiaolei at drone-009:~/tornadows-0.9.1/demos$ python soappy_client.py Traceback (most recent call last): File "soappy_client.py", line 59, in test_sms() File "soappy_client.py", line 31, in test_sms print server.sendMt(args) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in __call__ return self.__r_call(*args, **kw) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in __r_call self.__hd, self.__ma) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __call raise p SOAPpy.Types.faultType: : {'fault': : {'text': 'SoapHeader is null', 'messageId': 'SEV_0003'}, 'exceptionName': 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': 'ln_xxt_mh01'}> method 3: from SOAPpy import WSDL def test_sms(): """for sms """ url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" server = WSDL.Proxy(url) #print 'methods:',server.methods.keys() #print 'input type:',server.methods['sendMt'].inparams[0].type #print 'input name:',server.methods['sendMt'].inparams[0].name #print 'output type:',server.methods['sendMt'].outparams[0].type #print 'output name:',server.methods['sendMt'].outparams[0].name a = ['jia','xiao'] results=server.sendMt(a) print results # output: w_jiaxiaolei at drone-009:~/tornadows-0.9.1/demos$ python wsdl_client.py /usr/lib/pymodules/python2.6/SOAPpy/wstools/XMLSchema.py:2871: DeprecationWarning: object.__init__() takes no parameters tuple.__init__(self, args) Traceback (most recent call last): File "wsdl_client.py", line 48, in test_sms() File "wsdl_client.py", line 41, in test_sms results=server.sendMt(a) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in __call__ return self.__r_call(*args, **kw) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in __r_call self.__hd, self.__ma) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __call raise p SOAPpy.Types.faultType: : {'fault': : {'text': 'SoapHeader is null', 'messageId': 'SEV_0003'}, 'exceptionName': 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': 'ln_xxt_mh01'}> -- jiaxiaolei -------------- next part -------------- An HTML attachment was scrubbed... URL: From jiaxiaolei19871112 at gmail.com Tue Nov 29 04:25:29 2011 From: jiaxiaolei19871112 at gmail.com (=?GB2312?B?vNbP/sDa?=) Date: Tue, 29 Nov 2011 11:25:29 +0800 Subject: [Soap-Python] Exception in soap call In-Reply-To: References: <201111251936.35661.vsza@vsza.hu> Message-ID: 2011/11/26 ??? > thanks, i will try it later. > thanks! > > Hi, Veres: Sorry to interrupt you. do you still member the question last Friday. In fact , I tried webservice client in WSDL, SOAPpy, and Suds, while, all is failed. Now, I descript the question in detail, and if possible and time is rich, wish you can give me some extra points about the question: First of all, I will admire I am a novice to web service. What I need now is to invoke a method sendMt provided by the web service server(prehaps the server is made by java language using a framwork named Axis). I try to invoke the sendMt method provided by the server, then failded. There are the tests as follows: method 1: import suds def test_sms(): #TODO: it's failed url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" #client = suds.client.Client(url,faults=False) client = suds.client.Client(url) print 'client', client a = ['jia','xiao'] output = client.service.sendMt(a) print 'output', output # the output: client Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: R580-20091016 Service ( LNXxtSyncServiceService ) tns="service.global.v1_0.wsdl.protocol.xxt" Prefixes (3) ns0 = "http://common.v1_0.obj.protocol.xxt" ns1 = "http://schemas.xmlsoap.org/soap/encoding/" ns2 = "service.global.v1_0.wsdl.protocol.xxt" Ports (1): (LNXxtSyncService) Methods (5): sendMo(ArrayOf_soapenc_string moInfo, ) sendMt(ArrayOf_soapenc_string mtInfo, ) syncCorp(ArrayOf_tns2_GroupOrderInfo orderInfo, ) syncResponseRpt(ArrayOf_soapenc_string rpt, ) syncStaff(ArrayOf_tns2_UserOrderInfo orderInfo, ) Types (54): ns1:Array ArrayOf_soapenc_string ArrayOf_tns2_GroupOrderInfo ArrayOf_tns2_UserOrderInfo ns1:ENTITIES ns1:ENTITY ... No handlers could be found for logger "suds.client" Traceback (most recent call last): File "suds_client.py", line 124, in test_sms2() File "suds_client.py", line 99, in test_sms2 output = client.service.sendMt(a) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 535, in __call__ return client.invoke(args, kwargs) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 595, in invoke result = self.send(msg) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 630, in send result = self.failed(binding, e) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/client.py", line 681, in failed r, p = binding.get_fault(reply) File "/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/bindings/binding.py", line 235, in get_fault raise WebFault(p, faultroot) suds.WebFault: Server raised fault: 'No such operation 'sendMt'' #Note: 1: the url " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" is develped in Internet, anyone can use it. 2: in my view, the server is made by java Axis, and the inparams of sendmt is ArrayOf_soapenc_string(In java, it means a array of String, in python, it means a list whose items are string). 3: the problem has puzzled me for nearly a week, please someone can give me some points. # besides the suds, i try other methods as follows, whlie, still failed. method 2: from SOAPpy import SOAPProxy def test_sms(): """test for ln sms java webservice """ #TODO:invoke sms is stil failed url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService" server = SOAPProxy(url) args = ['jia','xiao'] print server.sendMt(args) # output: w_jiaxiaolei at drone-009:~/tornadows-0.9.1/demos$ python soappy_client.py Traceback (most recent call last): File "soappy_client.py", line 59, in test_sms() File "soappy_client.py", line 31, in test_sms print server.sendMt(args) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in __call__ return self.__r_call(*args, **kw) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in __r_call self.__hd, self.__ma) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __call raise p SOAPpy.Types.faultType: : {'fault': : {'text': 'SoapHeader is null', 'messageId': 'SEV_0003'}, 'exceptionName': 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': 'ln_xxt_mh01'}> method 3: from SOAPpy import WSDL def test_sms(): """for sms """ url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" server = WSDL.Proxy(url) #print 'methods:',server.methods.keys() #print 'input type:',server.methods['sendMt'].inparams[0].type #print 'input name:',server.methods['sendMt'].inparams[0].name #print 'output type:',server.methods['sendMt'].outparams[0].type #print 'output name:',server.methods['sendMt'].outparams[0].name a = ['jia','xiao'] results=server.sendMt(a) print results # output: w_jiaxiaolei at drone-009:~/tornadows-0.9.1/demos$ python wsdl_client.py /usr/lib/pymodules/python2.6/SOAPpy/wstools/XMLSchema.py:2871: DeprecationWarning: object.__init__() takes no parameters tuple.__init__(self, args) Traceback (most recent call last): File "wsdl_client.py", line 48, in test_sms() File "wsdl_client.py", line 41, in test_sms results=server.sendMt(a) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 470, in __call__ return self.__r_call(*args, **kw) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 492, in __r_call self.__hd, self.__ma) File "/usr/lib/pymodules/python2.6/SOAPpy/Client.py", line 406, in __call raise p SOAPpy.Types.faultType: : {'fault': : {'text': 'SoapHeader is null', 'messageId': 'SEV_0003'}, 'exceptionName': 'xxt.protocol.obj.v1_0.common.ServiceException', 'hostname': 'ln_xxt_mh01'}> -- Jia Xiaolei -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Tue Nov 29 07:58:14 2011 From: dieter at handshake.de (Dieter Maurer) Date: Tue, 29 Nov 2011 07:58:14 +0100 Subject: [Soap-Python] SOAPpy and WSDLs with nested urns... In-Reply-To: References: Message-ID: <20180.33414.421217.502828@localhost.localdomain> ??? wrote at 2011-11-29 11:04 +0800: > ... >What I need now is to invoke a method sendMt provided by the web service >server(prehaps the server is made by java language using a framwork named >Axis). > >I try to invoke the sendMt method provided by the server, then failded. >There are the tests as follows: > >method 1: > >import suds > >def test_sms(): > #TODO: it's failed > url = " >http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" > #client = suds.client.Client(url,faults=False) > client = suds.client.Client(url) > print 'client', client > a = ['jia','xiao'] > output = client.service.sendMt(a) > print 'output', output > > ># the output: > >client >Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: >R580-20091016 > >Service ( LNXxtSyncServiceService ) >tns="service.global.v1_0.wsdl.protocol.xxt" > Prefixes (3) > ns0 = "http://common.v1_0.obj.protocol.xxt" > ns1 = "http://schemas.xmlsoap.org/soap/encoding/" > ns2 = "service.global.v1_0.wsdl.protocol.xxt" > Ports (1): > (LNXxtSyncService) > Methods (5): > sendMo(ArrayOf_soapenc_string moInfo, ) > sendMt(ArrayOf_soapenc_string mtInfo, ) > syncCorp(ArrayOf_tns2_GroupOrderInfo orderInfo, ) > syncResponseRpt(ArrayOf_soapenc_string rpt, ) > syncStaff(ArrayOf_tns2_UserOrderInfo orderInfo, ) > Types (54): > ns1:Array > ArrayOf_soapenc_string > ArrayOf_tns2_GroupOrderInfo > ArrayOf_tns2_UserOrderInfo > ns1:ENTITIES > ns1:ENTITY > ... >No handlers could be found for logger "suds.client" You could avoid this warning message by initializing Python's logging. This would give you in addition a log entry for the response, I think. Logging initialization could be performed, e.g., by from logging import INFO, basicConfig basicConfig(level=INFO) >Traceback (most recent call last): > File "suds_client.py", line 124, in > ... > File >"/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/bindings/binding.py", > >line 235, in get_fault > raise WebFault(p, faultroot) >suds.WebFault: Server raised fault: 'No such operation 'sendMt'' This looks as if something where wrong on the server side. While the WSDL apparently lists a "sendMt" method, the server seems not to know about it. At your place, I would activate "suds.client" logging (the "suds" documentation tells you how) and carefully check the SOAP messages sent and received. Maybe, only the server message is misleading. "sendMt" might be known but its parameters might be unexpected ("Java" tends to bind functions and their signature and may tell "I do not know this function" when it means "I do not know this function with this signature"). With respect to the parameters, you are using "suds" slightly non standard. The WSDL tells you that "sendMT" expects an "ArrayOf_soapenc_string" parameter. However, you are passing a list. "suds" will try to convert but it may do something wrong. The "standard" way is to construct the parameters of the correct type using the client's "factory" and pass these. > ... >#Note: >1: the url " >http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" >is develped in Internet, anyone can use it. >2: in my view, the server is made by java Axis, and the inparams of sendmt >is ArrayOf_soapenc_string(In java, it means a array of String, in python, >it means a list whose items are string). It may be necessary to encapsulate the "list of strings" in an explicite "ArrayOf_soapenc_string". In fact, I expect that this is indeed necessary. >3: the problem has puzzled me for nearly a week, please someone can give me >some points. -- Dieter From jiaxiaolei19871112 at gmail.com Tue Nov 29 15:14:46 2011 From: jiaxiaolei19871112 at gmail.com (=?UTF-8?B?6LS+5pmT56OK?=) Date: Tue, 29 Nov 2011 22:14:46 +0800 Subject: [Soap-Python] SOAPpy and WSDLs with nested urns... In-Reply-To: <20180.33414.421217.502828@localhost.localdomain> References: <20180.33414.421217.502828@localhost.localdomain> Message-ID: very appreciate for your advices. maybe the kernel problem is the complexType ArrayOf_soapenc_string. part 1: how do you think the xml in the url: part 2: in fact, the server is made by Axis, which is a web service framework in Java. Before i develop the client, there already have a java client for the server. the code are below: if (temp.length % MTINFO_LENGTH != 0) { String[] remainBlock = new String[temp.length - jMark]; for (int i = 0; i < remainBlock.length; i++) { remainBlock[i] = temp[jMark]; jMark++; } mark = lnxss.sendMt(remainBlock); After read the code, we know that the the inparams of sendMt is String[]. In fact, the purpose of senMt() is to send some shotmessage to a mobile phone. you can find remobile in the parameters. part 3: Besides, the server has some check, which i have add it in the newest code. servicecode: PABB4BEIJING passwd: QWERTPABB namespace: service.global.v1_0.wsdl.protocol.xxt (you can see it in the url) I have tried to add the service code and passwd in the code. while, what still puzzled me is that in suds, how to add the namespace to the client. how to use the ArrayOf_soapen_string is a problem. in my code, i provide a list which contains some string. in my view, i should provide a object like your code, aoss = client.factory.create('ArrayOf_soapen_string') then, what should i do next? how to assign a value for the parameter of aoss? part 4: # the newest code : import suds def test_sms4(): import logging logging.basicConfig(level=logging.ERROR) url = " http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl" from suds.transport.https import HttpAuthenticated credentials = dict(username='PABB4BEIJING', password='QWERTPABB') t = HttpAuthenticated(**credentials) client = suds.client.Client(url,transport=t,cache=None,xstq=False,faults=False) #client = suds.client.Client(url,cache=None,xstq=False) aoss = client.factory.create('ArrayOf_soapenc_string') #client.set_options(namespace='service.global.v1_0.wsdl.protocol.xxt') print 'client', client item1 = "{'msgid':'1234567890','bizcode':'15140237310','serviceId':'1234567','recomobile':'15110791945','sendtime':'1322573860','content':'hi, this is just a test. you can ignore it. --jiaxiaolei'}" item2 = "{'msgid':'1234567891','bizcode':'15140237310','serviceId':'1234567','recomobile':'15110791946','sendtime':'1322573870','content':'hi, this is just a test. you can ignore it. --jiaxiaolei'}" req = [item1, item2] #client.service.sendMt(aoss) output = client.service.sendMt(mtinfo=req) print 'output', output # output: w_jiaxiaolei at drone-009:~/tornadows-0.9.1/demos$ python suds_client.py client Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: R580-20091016 Service ( LNXxtSyncServiceService ) tns="service.global.v1_0.wsdl.protocol.xxt" Prefixes (3) ns0 = "http://common.v1_0.obj.protocol.xxt" ns1 = "http://schemas.xmlsoap.org/soap/encoding/" ns2 = "service.global.v1_0.wsdl.protocol.xxt" Ports (1): (LNXxtSyncService) Methods (5): sendMo(ArrayOf_soapenc_string moInfo, ) sendMt(ArrayOf_soapenc_string mtInfo, ) syncCorp(ArrayOf_tns2_GroupOrderInfo orderInfo, ) syncResponseRpt(ArrayOf_soapenc_string rpt, ) syncStaff(ArrayOf_tns2_UserOrderInfo orderInfo, ) Types (54): ns1:Array ArrayOf_soapenc_string ArrayOf_tns2_GroupOrderInfo ArrayOf_tns2_UserOrderInfo ... ERROR:suds.client: output (500, (detail){ fault = (fault){ _href = "#id0" } exceptionName = "xxt.protocol.obj.v1_0.common.ServiceException" hostname = "ln_xxt_mh01" }) -- jiaxiaolei On Tue, Nov 29, 2011 at 2:58 PM, Dieter Maurer wrote: > ??? wrote at 2011-11-29 11:04 +0800: > > ... > >What I need now is to invoke a method sendMt provided by the web service > >server(prehaps the server is made by java language using a framwork named > >Axis). > > > >I try to invoke the sendMt method provided by the server, then failded. > >There are the tests as follows: > > > >method 1: > > > >import suds > > > >def test_sms(): > > #TODO: it's failed > > url = " > > > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl > " > > #client = suds.client.Client(url,faults=False) > > client = suds.client.Client(url) > > print 'client', client > > a = ['jia','xiao'] > > output = client.service.sendMt(a) > > print 'output', output > > > > > ># the output: > > > >client > >Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: > >R580-20091016 > > > >Service ( LNXxtSyncServiceService ) > >tns="service.global.v1_0.wsdl.protocol.xxt" > > Prefixes (3) > > ns0 = "http://common.v1_0.obj.protocol.xxt" > > ns1 = "http://schemas.xmlsoap.org/soap/encoding/" > > ns2 = "service.global.v1_0.wsdl.protocol.xxt" > > Ports (1): > > (LNXxtSyncService) > > Methods (5): > > sendMo(ArrayOf_soapenc_string moInfo, ) > > sendMt(ArrayOf_soapenc_string mtInfo, ) > > syncCorp(ArrayOf_tns2_GroupOrderInfo orderInfo, ) > > syncResponseRpt(ArrayOf_soapenc_string rpt, ) > > syncStaff(ArrayOf_tns2_UserOrderInfo orderInfo, ) > > Types (54): > > ns1:Array > > ArrayOf_soapenc_string > > ArrayOf_tns2_GroupOrderInfo > > ArrayOf_tns2_UserOrderInfo > > ns1:ENTITIES > > ns1:ENTITY > > ... > >No handlers could be found for logger "suds.client" > > You could avoid this warning message by initializing Python's logging. > This would give you in addition a log entry for the response, I think. > > Logging initialization could be performed, e.g., by > > from logging import INFO, basicConfig > basicConfig(level=INFO) > > >Traceback (most recent call last): > > File "suds_client.py", line 124, in > > ... > > File > > >"/usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/bindings/binding.py", > > > >line 235, in get_fault > > raise WebFault(p, faultroot) > >suds.WebFault: Server raised fault: 'No such operation 'sendMt'' > > This looks as if something where wrong on the server side. > > While the WSDL apparently lists a "sendMt" method, the server seems not > to know about it. > > > At your place, I would activate "suds.client" logging (the "suds" > documentation tells you how) and carefully check the SOAP messages > sent and received. > > > Maybe, only the server message is misleading. "sendMt" might be known > but its parameters might be unexpected ("Java" tends to bind functions > and their signature and may tell "I do not know this function" when > it means "I do not know this function with this signature"). > > With respect to the parameters, you are using "suds" slightly non standard. > The WSDL tells you that "sendMT" expects an "ArrayOf_soapenc_string" > parameter. However, you are passing a list. "suds" will try to > convert but it may do something wrong. > The "standard" way is to construct the parameters of the correct type > using the client's "factory" and pass these. > > > ... > >#Note: > >1: the url " > > > http://211.137.45.104:9006/LnXxtCpInterface/services/LNXxtSyncService?wsdl > " > >is develped in Internet, anyone can use it. > >2: in my view, the server is made by java Axis, and the inparams of sendmt > >is ArrayOf_soapenc_string(In java, it means a array of String, in python, > >it means a list whose items are string). > > It may be necessary to encapsulate the "list of strings" in > an explicite "ArrayOf_soapenc_string". In fact, I expect that this is > indeed necessary. > > >3: the problem has puzzled me for nearly a week, please someone can give > me > >some points. > > > > -- > Dieter > -- NAME: ???/Jia Xiaolei MOBILE: 13011292217 QQ: 281304051 MICRO-BLOG: http://weibo.com/2183890715 GMAIL: jiaxiaolei19871112 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Wed Nov 30 11:26:45 2011 From: dieter at handshake.de (Dieter Maurer) Date: Wed, 30 Nov 2011 11:26:45 +0100 Subject: [Soap-Python] SOAPpy and WSDLs with nested urns... In-Reply-To: References: Message-ID: <20182.1253.985163.312366@localhost.localdomain> ??? wrote at 2011-11-29 22:14 +0800: >very appreciate for your advices. maybe the kernel problem is the >complexType ArrayOf_soapenc_string. > >part 1: how do you think the xml in the url: > > > > > > > > XML-Schema is quite complex, too complex for me to tell how the XML should look like for the type definition above. I hope that "suds" will know how to serialize corresponding objects. >part 2: in fact, the server is made by Axis, which is a web service >framework in Java. >Before i develop the client, there already have a java client for the >server. >the code are below: > >if (temp.length % MTINFO_LENGTH != 0) { >String[] remainBlock = new String[temp.length - jMark]; >for (int i = 0; i < remainBlock.length; i++) { >remainBlock[i] = temp[jMark]; >jMark++; >} > >mark = lnxss.sendMt(remainBlock); > >After read the code, we know that the the inparams of sendMt is String[]. >In fact, the purpose of senMt() is to send some shotmessage to a mobile >phone. you can find remobile in the parameters. You cannot necessarily translate Java code examples literally to Python. XML-Schema (and SOAP) is made to provide interoperability at the XML level, not the language level. As I wrote, "suds" usually uses a factory to create type instances. For them, it knows how to serialize them. "suds" often allows to pass simple Python type instances and does the right thing. But, in your special case, it might not... >part 3: Besides, the server has some check, which i have add it in the >newest code. > >servicecode: PABB4BEIJING >passwd: QWERTPABB >namespace: service.global.v1_0.wsdl.protocol.xxt (you can see it in the url) Usually, "suds" adds namespaces as directed by the WSDL. >I have tried to add the service code and passwd in the code. > while, what still puzzled me is that in suds, how to add the namespace >to the client. >how to use the ArrayOf_soapen_string is a problem. in my code, i provide a >list which contains some string. in my view, i should provide a object like >your code, >aoss = client.factory.create('ArrayOf_soapen_string') >then, what should i do next? how to assign a value for the parameter of >aoss? I do not know. I have not used "suds" with types of the kind you have shown above. In my cases, "print obj" has shown me what attributes "obj" has and I have assigned values to them. That was is. I do not know how "suds" handles XML-Schema "restriction". Maybe, you find something in the "suds" documentation? >part 4: > ># the newest code : >import suds >def test_sms4(): > import logging > logging.basicConfig(level=logging.ERROR) > ... > req = [item1, item2] > > #client.service.sendMt(aoss) > output = client.service.sendMt(mtinfo=req) > print 'output', output > > > ># output: > ... >xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi=" >http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV=" >http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle=" >http://schemas.xmlsoap.org/soap/encoding/"> > > > > > As you can see, the parameter has not been serialized correctly. The reason might be that "suds" does not accept a list as an "ArrayOf_soapenc_string" (in this case, some fiddling with a properly constructed instance might help) or that it cannot handle this type at all (in which case, you would need to contact the author, maybe via a bug tracker). -- Dieter From llemeur at allocine.fr Wed Nov 30 15:34:51 2011 From: llemeur at allocine.fr (LE MEUR Laurent) Date: Wed, 30 Nov 2011 15:34:51 +0100 Subject: [Soap-Python] rpclib, Infopath and the options http verb Message-ID: <74205AE1915EFE49AA22550E5E5BE525ECFAD9@hermes.ac-net.net> First, I want to thank Burak for his work on rpclib ; I successfullly use dit along with Suds for simple needs. Then, I'd like to ask some help about an issue that is not related to rpclib per se, but rather to the default http server used for tests. I tried to connect an MS Infopath form to an rpclib WS, but the client sends an OPTIONS request, and the server responds with a 405. How can I configure the http server to accept this verb ? Thanks in advance Laurent