From llemeur at allocine.fr Sun Jul 3 17:49:02 2011 From: llemeur at allocine.fr (Laurent Le Meur) Date: Sun, 3 Jul 2011 15:49:02 +0000 (UTC) Subject: [Soap-Python] suds and soaplib without internet access References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> Message-ID: And by the way I now see that this line is exactly where one expects the import of the soap encoding schema (in the case of an RPC style + SOAP encoding Web Service) note that my test server includes the line @rpc(String,Integer,_returns=Array(String)) which means that the rpc style (with an implied soap encoding?) is used. Therefore I can imagine that the source of the issue is a mistake in the inclusion of the soap encoding url in the soaplib code. From llemeur at allocine.fr Mon Jul 4 00:37:26 2011 From: llemeur at allocine.fr (Laurent Le Meur) Date: Sun, 3 Jul 2011 22:37:26 +0000 (UTC) Subject: [Soap-Python] suds and soaplib without internet access References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> Message-ID: I guess I could have found the source of this bug in xsd_gen.py: l659 for namespace in schema_entries.imports[pref]: import_ = etree.SubElement(schema, "{%s}import"% namespaces.ns_xsd) import_.set("namespace", namespace) could really end with instead of but I'd prefer the maintainers of soaplib to check this ;-) note : if to taken into account in a few days, I'll post it to github. Best regards. Laurent From llemeur at allocine.fr Wed Jul 6 22:57:24 2011 From: llemeur at allocine.fr (Laurent Le Meur) Date: Wed, 6 Jul 2011 20:57:24 +0000 (UTC) Subject: [Soap-Python] suds and soaplib without internet access References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> Message-ID: Laurent Le Meur writes: After more investigation I opened an issue at https://github.com/soaplib/soaplib/issues. Best regards. Laurent From rj-soaplib at sysgroup.fr Thu Jul 7 09:43:53 2011 From: rj-soaplib at sysgroup.fr (Remi Jolin) Date: Thu, 07 Jul 2011 09:43:53 +0200 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> Message-ID: <4E1563B9.1060500@sysgroup.fr> Le 06/07/2011 22:57, Laurent Le Meur a ?crit : > Laurent Le Meur writes: > > After more investigation I opened an issue at > https://github.com/soaplib/soaplib/issues. > I'm not sure it is a soaplib issue : If you access your soaplib based server with another client (non suds) like a flash application built with flash builder, you don't get this delay. From burak.arslan at arskom.com.tr Thu Jul 7 11:21:46 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 07 Jul 2011 12:21:46 +0300 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: <4E1563B9.1060500@sysgroup.fr> References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> <4E1563B9.1060500@sysgroup.fr> Message-ID: <4E157AAA.7070303@arskom.com.tr> On 07/07/11 10:43, Remi Jolin wrote: > Le 06/07/2011 22:57, Laurent Le Meur a ?crit : >> Laurent Le Meur writes: >> >> After more investigation I opened an issue at >> https://github.com/soaplib/soaplib/issues. >> > I'm not sure it is a soaplib issue : > If you access your soaplib based server with another client (non suds) > like a flash application built with flash builder, you don't get this > delay. > hi, it's not a soaplib issue per se, it's the client's decision to fetch & store remote schema imports (or not). but it's not necessary to include it either, as soap clients tested with soaplib don't complain about the missing import. this was introduced here: https://github.com/soaplib/soaplib/commit/f88dca6671083a54dad7cb00b9d034cdb8dd0e73#L1L84 As this change had no apparent benefit at all, i reverted it for rpclib here: https://github.com/arskom/rpclib/commit/e87bbdc4cccc381ef3477295a2882703aa23a0a3 you can make the same change in soaplib to make the import go away. (note that i don't advise you to use rpclib yet. it's colossally awesomer than soaplib, but its documentation is a mess :) ) best, burak From tseaver at palladion.com Fri Jul 8 00:34:20 2011 From: tseaver at palladion.com (Tres Seaver) Date: Thu, 07 Jul 2011 18:34:20 -0400 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: <4E157AAA.7070303@arskom.com.tr> References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> <4E1563B9.1060500@sysgroup.fr> <4E157AAA.7070303@arskom.com.tr> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/07/2011 05:21 AM, Burak Arslan wrote: > it's not a soaplib issue per se, it's the client's decision to fetch > & store remote schema imports (or not). but it's not necessary to > include it either, as soap clients tested with soaplib don't complain > about the missing import. > > this was introduced here: > > https://github.com/soaplib/soaplib/commit/f88dca6671083a54dad7cb00b9d034cdb8dd0e73#L1L84 > > As this change had no apparent benefit at all, i reverted it for > rpclib here: The point of the change was to make it possible to emit WSDL which conforms to standards (WSRP[1] was the motivating example) which mandate mapping some portions of a request / response as attributes, rather than sub-elements, Without that option, one cannot use soaplib to implement an interoperable WSRP server; with it, one can (see wsrplib[2]). [1] http://en.wikipedia.org/wiki/Web_Services_for_Remote_Portlets [2] https://github.com/soaplib/wsrplib Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4WNGwACgkQ+gerLs4ltQ4haQCfaHjaWn1bN8zLGE6dZYiDti2O tn8An1MrM2O1B5UQPvdyHA0iMplHVE0h =fn+c -----END PGP SIGNATURE----- From burak.arslan at arskom.com.tr Fri Jul 8 12:22:09 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 08 Jul 2011 13:22:09 +0300 Subject: [Soap-Python] suds and soaplib without internet access In-Reply-To: References: <941EF918-7165-4FF2-8B43-60DB5D14D00B@polyconseil.fr> <4E089C32.5040900@sysgroup.fr> <1309214242.16951.5.camel@D820> <4E1563B9.1060500@sysgroup.fr> <4E157AAA.7070303@arskom.com.tr> Message-ID: <4E16DA51.1050406@arskom.com.tr> On 07/08/11 01:34, Tres Seaver wrote: > On 07/07/2011 05:21 AM, Burak Arslan wrote: > > > it's not a soaplib issue per se, it's the client's decision to fetch > > & store remote schema imports (or not). but it's not necessary to > > include it either, as soap clients tested with soaplib don't complain > > about the missing import. > > > this was introduced here: > > > > https://github.com/soaplib/soaplib/commit/f88dca6671083a54dad7cb00b9d034cdb8dd0e73#L1L84 > > > As this change had no apparent benefit at all, i reverted it for > > rpclib here: > > The point of the change was to make it possible to emit WSDL which > conforms to standards (WSRP[1] was the motivating example) which mandate > mapping some portions of a request / response as attributes, rather than > sub-elements, Without that option, one cannot use soaplib to implement > an interoperable WSRP server; with it, one can (see wsrplib[2]). > well, it's The Right Thing(tm) to do anyway. so here's my take at it: https://github.com/arskom/rpclib/commit/5b18c648885e45e47e37c09e93b44877da18fc2c best, burak From antoine.humbert at free.fr Fri Jul 15 16:00:43 2011 From: antoine.humbert at free.fr (antoine.humbert at free.fr) Date: Fri, 15 Jul 2011 16:00:43 +0200 (CEST) Subject: [Soap-Python] soaplib bug in output headers WSDL description Message-ID: <18808558.185021310738443399.JavaMail.root@spooler3-g27.priv.proxad.net> Hello, when defining an output header to a service, the WSDL produced by the server is incorrect : the type description for out header is the same as the input header one. The problem is in the add_bindings_for_methods of the DefinitionBase class in service.py : seems to be a bad copy/paste of code : if not (method.is_async or method.is_callback): output = etree.SubElement(operation, '{%s}output' % ns_wsdl) output.set('name', method.out_message.get_type_name()) soap_body = etree.SubElement(output, '{%s}body' % ns_soap) soap_body.set('use', 'literal') # get input soap header out_header = method.in_header if out_header is None: out_header = self.__in_header__ should be replaced by if not (method.is_async or method.is_callback): output = etree.SubElement(operation, '{%s}output' % ns_wsdl) output.set('name', method.out_message.get_type_name()) soap_body = etree.SubElement(output, '{%s}body' % ns_soap) soap_body.set('use', 'literal') # get output soap header out_header = method.out_header if out_header is None: out_header = self.__out_header__ Regards, Antoine HUMBERT From antoine.humbert at free.fr Fri Jul 15 16:17:41 2011 From: antoine.humbert at free.fr (antoine.humbert at free.fr) Date: Fri, 15 Jul 2011 16:17:41 +0200 (CEST) Subject: [Soap-Python] [soaplib] Method not found problem In-Reply-To: <26383859.186381310739421413.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <28387601.186461310739461715.JavaMail.root@spooler3-g27.priv.proxad.net> Hello, when defining the _in_message property of a service operation, the operation cannot be called : Consider the following server code: from wsgiref.simple_server import make_server from soaplib.core import Application from soaplib.core.server import wsgi from soaplib.core.model.primitive import String, Integer from soaplib.core.service import DefinitionBase, soap class BugService(DefinitionBase): ''' Sample service ''' @soap(Integer, _public_name="urn:#getBugLabel", _in_message="getBugLabelMsgIn", _out_variable_names=("bugLabel",), _returns=(String)) def getBugLabel(self, bugCode): if bugCode == 0: return 'not a bug' else: return 'evil bug' if __name__ == '__main__': soap_app = Application([BugService], 'http://example.com/bug', name='BugService') wsgi_app = wsgi.Application(soap_app) server = make_server('localhost', 7789, wsgi_app) server.serve_forever() The produced WSDL From antoine.humbert at free.fr Fri Jul 15 17:29:14 2011 From: antoine.humbert at free.fr (antoine.humbert at free.fr) Date: Fri, 15 Jul 2011 17:29:14 +0200 (CEST) Subject: [Soap-Python] [soaplib] Method not found problem In-Reply-To: <1951289.188781310740682349.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <9667803.192841310743754466.JavaMail.root@spooler3-g27.priv.proxad.net> Hello, when defining the _in_message property of a service operation, the operation cannot be called : Considering the following server code: ------------------ from wsgiref.simple_server import make_server from soaplib.core import Application from soaplib.core.server import wsgi from soaplib.core.model.primitive import String, Integer from soaplib.core.service import DefinitionBase, soap class BugService(DefinitionBase): ''' Sample service ''' @soap(Integer, _public_name="urn:#getBugLabel", _in_message="getBugLabelMsgIn", _out_message="getButLabelMsgOut", _out_variable_name="bugLabel", _returns=String) def getBugLabel(self, bugCode): if bugCode == 0: return 'not a bug' else: return 'evil bug' if __name__ == '__main__': soap_app = Application([BugService], 'http://example.com/bug', name='BugService') wsgi_app = wsgi.Application(soap_app) server = make_server('localhost', 7789, wsgi_app) server.serve_forever() --------------- The produced WSDL looks correct : --------------- ------------------ But when using suds to access the service, I get the following error: suds.WebFault: Server raised fault: 'Method not found: '{http://example.com/bug}getBugLabelMsgIn' The code for the client is: ----------------- import logging from suds.client import Client if __name__ == '__main__': logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.DEBUG) ws_client = Client('http://localhost:7789/wsdl', cache=None) res = ws_client.service.getBugLabel(2) print res ---------------- The request sent by the client is : DEBUG:suds.client:sending to (http://localhost:7789/wsdl) message: 2 DEBUG:suds.client:headers = {'SOAPAction': u'"urn:#getBugLabel"', 'Content-Type': 'text/xml; charset=utf-8'} ----- Looking at the soaplib/core/_base.py module, it seems that the method name is retrieved by getting the first tag name of the SOAP Body (which is the input message name) rather than getting the SOAPAction of the HTTP header. So, in order have the service responding correctly to requests, it is necessary that the input message name is the same as the operation name. Antoine HUMBERT From burak.arslan at arskom.com.tr Fri Jul 15 23:49:57 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sat, 16 Jul 2011 00:49:57 +0300 Subject: [Soap-Python] [soaplib] Method not found problem In-Reply-To: <9667803.192841310743754466.JavaMail.root@spooler3-g27.priv.proxad.net> References: <9667803.192841310743754466.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <4E20B605.4030107@arskom.com.tr> On 07/15/11 18:29, antoine.humbert at free.fr wrote: > Hello, > > when defining the _in_message property of a service operation, the operation cannot be called : > > *snip* > > Looking at the soaplib/core/_base.py module, it seems that the method name is retrieved by getting the first tag name of the SOAP Body (which is the input message name) rather than getting the SOAPAction of the HTTP header. hi antoine, thank you very much for the detailed analysis. but i think the right thing to do is to have the function name looked up via its message name, because the SOAPAction HTTP header is just a http-specific extension and is not available with other transports. i'll look into it and let you know. best regards, burak From burak.arslan at arskom.com.tr Fri Jul 15 23:44:58 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sat, 16 Jul 2011 00:44:58 +0300 Subject: [Soap-Python] soaplib bug in output headers WSDL description In-Reply-To: <18808558.185021310738443399.JavaMail.root@spooler3-g27.priv.proxad.net> References: <18808558.185021310738443399.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <4E20B4DA.5070108@arskom.com.tr> On 07/15/11 17:00, antoine.humbert at free.fr wrote: > Hello, > > when defining an output header to a service, the WSDL produced by the server is incorrect : the type description for out header is the same as the input header one. > > The problem is in the add_bindings_for_methods of the DefinitionBase class in service.py : seems to be a bad copy/paste of code : antoine, thanks a lot for letting us know about this. best regards, burak From burak.arslan at arskom.com.tr Sun Jul 17 12:15:34 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 17 Jul 2011 13:15:34 +0300 Subject: [Soap-Python] [soaplib] Method not found problem In-Reply-To: <20108459.223601310801030923.JavaMail.root@spooler3-g27.priv.proxad.net> References: <20108459.223601310801030923.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <4E22B646.5010407@arskom.com.tr> On 07/16/11 10:23, antoine.humbert at free.fr wrote: > To solve the problem, I simply replaced the following line in the > build_schema method of Application class: > < method_name = "{%s}%s" % (self.get_tns(), method.name) > by > So, the problem is just in the Application class which consider the > MethodContext.method_name as the "real" service method name whereas > the DefinitionBase consider it as the input message name. >> method_name = "{%s}%s" % (method.in_message.get_namespace(), method.in_message.get_type_name()) > so that the method_name used in the Application class (throught the MethodContext.method_name build from the body.tag) has the same meaning as the method name passed to Service.get_method. > > I've been testing this patch with service method with the default in_message name, and after overriding the in_message_name : it's OK. > Hi Antoine, method.in_message.get_namespace() is not ready at that point -- if you print it, you'll see that it's the DEFAULT_NS class. As the auto-generated messages always belong to the targetNamespace, you should use self.get_tns() there instead of in_message.get_namespace(). I've done some improvements related to those parts of the code, and i've also added a test. have a look at http://github.com/arskom/rpclib/network . what do you think? best, burak From burak.arslan at arskom.com.tr Mon Jul 18 10:17:59 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 18 Jul 2011 11:17:59 +0300 Subject: [Soap-Python] [soaplib] Method not found problem In-Reply-To: <12152865.290941310904885177.JavaMail.root@spooler3-g27.priv.proxad.net> References: <12152865.290941310904885177.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <4E23EC37.7070800@arskom.com.tr> On 07/17/11 15:14, antoine.humbert at free.fr wrote: > Thus, for me, it makes sense to identify the incoming message with > in_message.get_namespace() rather than with self.get_tns(). > For now, we can't specify a different namespace for the input message type definition, so both methods give the same result. > > I'm not sure that this feature is really necessary. I'd like to have it because I'm using soaplib to create a stub for a WS which for I have the wsdl but can't access to it right now. It is absolutely useless if you build your WS with soaplib and use the "auto-generated" wsdl. > I think this feature is necessary. But, how do you think the api should work? Would you be OK with adding an additional "_{in,out}_message_ns" argument to the @rpc decorator? > ----- > > Also, i would like to contribute to another improvement : > - at the moment, the in_header and out_header are composed of a single element, but the specification authorize multiple elements in the soap header. This is already managed by suds (you can affect a tuple to the soapheaders option), and is commonly used to distinguish the different kind of headers (authentication header, message identifier header, trace header, ...) > > So, I-d like to modify the use of __in_header__, __out_header__, _in_header, _out_header, ... to authorize either a single model, or a tuple/list of models. > I think this feature is also necessary, and I'd love to see a patch. > What is the best way for me to contribute to this (if you agree) : should I have to fork the soaplib project or your rpclib project ? What is the relationship between the two projects ? > I wrote most of what soaplib is today. rpclib is in fact soaplib-3.0, see the change log here: https://github.com/arskom/rpclib/blob/master/CHANGELOG. It's also what i'm going to be working on in the future. There was a plan to move soap code from rpclib to soaplib, but this is not a priority task in my to-do list. There are two issues with rpclib as it is: 1) The protocol api is not well-tested -- it might need changes in the future. 2) The documentation is seriously out-of-date. ... hence the alpha tag in its versions. Otherwise it's stable (both in terms of application api and code maturity) as a soap server. those said, i'd prefer you to contribute to rpclib, because i'm going to have to port your patches to rpclib anyway if you contribute to soaplib. i hope that helps. best regards, burak From tsah at pheer.it Wed Jul 20 12:51:31 2011 From: tsah at pheer.it (Tsah Zelenka) Date: Wed, 20 Jul 2011 12:51:31 +0200 Subject: [Soap-Python] Self referencing object & simpleContent question Message-ID: <20110720125131.464da186@sol068.oma.be> Hello, I need to make a SOAP server implementing an existing WSDL. There are two things that i don't know how to design in python : - A complex type whom is referencing to itself - A simpleContent, for example a string with attributes. Is there any way to implement them with soaplib? Best regards, T. From antoine.humbert at free.fr Wed Jul 20 19:44:21 2011 From: antoine.humbert at free.fr (antoine.humbert at free.fr) Date: Wed, 20 Jul 2011 19:44:21 +0200 (CEST) Subject: [Soap-Python] Self referencing object & simpleContent question In-Reply-To: <20110720125131.464da186@sol068.oma.be> Message-ID: <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> To self reference a a complex type, you hace to use something like : class Foo(ComplexModel): bar = None Foo.bar = Foo To create a String type with attributes, I think you should use something like class Foo(ComplexModel): __extends__ = String attr = XMLAttribute('xs:string') This will give the correct definition in the wsdl but you won't be able to instantiate any object of this class. Moreover, I don't know how you could set the text of the element. I think there is a lack in the api for this. Regards Antoine ----- "Tsah Zelenka" a ?crit : > Hello, > > I need to make a SOAP server implementing an existing WSDL. There are > two things that i don't know how to design in python : > - A complex type whom is referencing to itself > - A simpleContent, for example a string with attributes. > > Is there any way to implement them with soaplib? > > Best regards, > T. > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From burak.arslan at arskom.com.tr Thu Jul 21 09:23:33 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 21 Jul 2011 10:23:33 +0300 Subject: [Soap-Python] Self referencing object & simpleContent question In-Reply-To: <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> References: <20110720125131.464da186@sol068.oma.be> <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <1311233013.1664.5.camel@Nokia-N900> ----- Original message ----- > To self reference a a complex type, you hace to use something like : > > class Foo(ComplexModel): >? ? ? bar = None > > Foo.bar = Foo > > To create a String type with attributes, I think you should use > something like > > class Foo(ComplexModel): >? ? ? __extends__ = String >? ? ? attr = XMLAttribute('xs:string') > class Foo(ComplexModel): class Attributes(ComplexModel.Attributes) attr = String Foo._type_info['bar'] = Foo if i'm not mistaken. check with the source code. best, burak > This will give the correct definition in the wsdl but you won't be able > to instantiate any object of this class. Moreover, I don't know how you > could set the text of the element. I think there is a lack in the api > for this. > > > Regards > > Antoine > > ----- "Tsah Zelenka" a ?crit : > > > Hello, > > > > I need to make a SOAP server implementing an existing WSDL. There are > > two things that i don't know how to design in python : > > - A complex type whom is referencing to itself > > - A simpleContent, for example a string with attributes. > > > > Is there any way to implement them with soaplib? > > > > Best regards, > > T. > > _______________________________________________ > > Soap mailing list > > Soap at python.org > > http://mail.python.org/mailman/listinfo/soap > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap -------------- next part -------------- An HTML attachment was scrubbed... URL: From tribaal at gmail.com Thu Jul 21 17:20:30 2011 From: tribaal at gmail.com (Tribaal) Date: Thu, 21 Jul 2011 17:20:30 +0200 Subject: [Soap-Python] Django "integration" Message-ID: Hi list, I am currently working on a Django "integration" for soaplib, to let people create a SOAP webservice and hook it in their django urls.py, if they fancy. I am starting to think that I must however not be the only person on the planet trying to do this - did anybody produce a clean and working interface to soaplib *2.0* for django? My "solution" is based off a snippet I found for soaplib 1.0, but had to be heavily adapted, and works-ish (still a problem with the SUDS client I use for testing). Should I be the first to try this kind of thing, I will be glad to contribute back some code to soaplib. Would a DjangoApplication class (in a fashion similar to the WSGI Application class) be welcome? Thanks - Chris From aymeric.augustin at polyconseil.fr Thu Jul 21 17:46:27 2011 From: aymeric.augustin at polyconseil.fr (Aymeric Augustin) Date: Thu, 21 Jul 2011 17:46:27 +0200 Subject: [Soap-Python] Django "integration" In-Reply-To: References: Message-ID: Hi Chris, You may want to take a look at http://packages.python.org/twod.wsgi/ which is designed to embed WSGI apps in Django. In our current project, we're achieving the same result using this code: http://dpaste.com/hold/573374/ We finish the modules that define our webservices with: app = Application([...], 'tns', name="...") (where Application is the class defined in my snippet). In development we use this URLconf: urlpatterns = patterns('', url(r'^my_ws/', my_ws.as_django_view()), ) In production, we use directly my_ws.as_wsgi() as a WSGI application. This takes care of closing the connections to the database, which doesn't happen if you skip Django's request handlers. Best regards, Aymeric AUGUSTIN Polyconseil | 11bis, rue Scribe | 75009 Paris mob : (+33) 6 22 43 79 99 tel : (+33) 1 58 18 67 40 | fax : (+33) 1 47 42 38 32 On 21 juil. 2011, at 17:20, Tribaal wrote: > Hi list, > > I am currently working on a Django "integration" for soaplib, to let > people create a SOAP webservice and hook it in their django urls.py, > if they fancy. > > I am starting to think that I must however not be the only person on > the planet trying to do this - did anybody produce a clean and working > interface to soaplib *2.0* for django? My "solution" is based off a > snippet I found for soaplib 1.0, but had to be heavily adapted, and > works-ish (still a problem with the SUDS client I use for testing). > > Should I be the first to try this kind of thing, I will be glad to > contribute back some code to soaplib. Would a DjangoApplication class > (in a fashion similar to the WSGI Application class) be welcome? > > Thanks > > - Chris > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsah at pheer.it Fri Jul 22 00:18:17 2011 From: tsah at pheer.it (Tsah Zelenka) Date: Fri, 22 Jul 2011 00:18:17 +0200 Subject: [Soap-Python] Self referencing object & simpleContent question In-Reply-To: <1311233013.1664.5.camel@Nokia-N900> References: <20110720125131.464da186@sol068.oma.be> <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> <1311233013.1664.5.camel@Nokia-N900> Message-ID: <20110722001817.54fbfe5f@ac1d> On Thu, 21 Jul 2011 10:23:33 +0300 Burak Arslan wrote: > ----- Original message ----- > > To self reference a a complex type, you hace to use something like : > > > > class Foo(ComplexModel): > >? ? ? bar = None > > > > Foo.bar = Foo It's not working (wrong wsdl and meaningless attribute when used) > class Foo(ComplexModel): > class Attributes(ComplexModel.Attributes) > attr = String > > Foo._type_info['bar'] = Foo > > if i'm not mistaken. check with the source code. Ok that's working, but it's not very straightforward (and undocumented) so yesterday i was messing around with the src code and forked soaplib on github. I came with this (so far, it's working) : https://github.com/tzelen/soaplib/commit/eb9f910458d6d1df3f4b54c2c84a82cb63e4171a Example : class Object(ClassModel): value = AutoRef # value will be Object in the wsdl generation and in the xml objects. With _type_info explained here I looked to patch ClassModelMeta.__new__() to add an exception in the "populate soap member" section to accept something like 'self' (django model style) to do the self referencing. I think it would be simple and easy, but since the type is only created at the end of __new__(), it need a 2-pass algorithm and would probably be ugly. Any thought on adding a mechanism for the self referencing vs editing _type_info by hand? Best regards, T. From burak.arslan at arskom.com.tr Fri Jul 22 09:59:14 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Fri, 22 Jul 2011 10:59:14 +0300 Subject: [Soap-Python] Self referencing object & simpleContent question In-Reply-To: <20110722001817.54fbfe5f@ac1d> References: <20110720125131.464da186@sol068.oma.be> <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> <1311233013.1664.5.camel@Nokia-N900> <20110722001817.54fbfe5f@ac1d> Message-ID: <1311321554.2535.18.camel@Nokia-N900> ----- Original message ----- > On Thu, 21 Jul 2011 10:23:33 +0300 > Burak Arslan wrote: > > > ----- Original message ----- > > > To self reference a a complex type, you hace to use something like : > > > > > > class Foo(ComplexModel): > > > ? ? ?? bar = None > > > > > > Foo.bar = Foo > > It's not working (wrong wsdl and meaningless attribute when used) > > > class Foo(ComplexModel): > > class Attributes(ComplexModel.Attributes) > > attr = String > > > > Foo._type_info['bar'] = Foo > > > > if i'm not mistaken. check with the source code. > > Ok that's working, but it's not very straightforward (and undocumented) > so yesterday i was messing around with the src code and forked soaplib > on github. I came with this (so far, it's working) : > https://github.com/tzelen/soaplib/commit/eb9f910458d6d1df3f4b54c2c84a82cb63e4171a > > Example : > class Object(ClassModel): >? ? ? ? value = AutoRef > # value will be Object in the wsdl generation and in the xml objects. > > With _type_info explained here I looked to patch > ClassModelMeta.__new__() to add an exception in the "populate soap > member" section to accept something like 'self' (django model style) > to do the self referencing. I think it would be simple and easy, but > since the type is only created at the end of __new__(), it need a > 2-pass algorithm and would probably be ugly. > > Any thought on adding a mechanism for the self referencing vs editing > _type_info by hand? > to do that, you need to hack __init__ and not __new__ in the metaclass. best, burak > Best regards, > T. > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsah at pheer.it Tue Jul 26 22:46:59 2011 From: tsah at pheer.it (Tsah Zelenka) Date: Tue, 26 Jul 2011 22:46:59 +0200 Subject: [Soap-Python] Self referencing object & simpleContent question In-Reply-To: <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> References: <20110720125131.464da186@sol068.oma.be> <2391161.675801311183861040.JavaMail.root@spooler3-g27.priv.proxad.net> Message-ID: <20110726224659.25030383@ac1d> On Wed, 20 Jul 2011 19:44:21 +0200 (CEST) antoine.humbert at free.fr wrote: > To create a String type with attributes, I think you should use > something like > > class Foo(ComplexModel): > __extends__ = String > attr = XMLAttribute('xs:string') > > This will give the correct definition in the wsdl but you won't be > able to instantiate any object of this class. Moreover, I don't know > how you could set the text of the element. I think there is a lack in > the api for this. If someone is interested, i made this. Seem to work. https://github.com/tzelen/soaplib/commit/bbf5bb80ed2f8ce56223c2e8b1155840f4254ac1 Regards, T. From tsah at pheer.it Wed Jul 27 19:15:46 2011 From: tsah at pheer.it (Tsah Zelenka) Date: Wed, 27 Jul 2011 19:15:46 +0200 Subject: [Soap-Python] XMLAttribute ignored in ClassModelBase.from_xml() Message-ID: <20110727191546.23a42256@ac1d> Hello, It seem that if a complexType is send to soaplib its attributes are not processed. In from_xml(), the method has a main loop itering over the xml element's childrens and ignore the attributes. Here is a small fix, with limited support for integer/long attributes : https://github.com/tzelen/soaplib/commit/2e7baa903091a3e59e17ed7d7cca797636f85640 Regards, T. From burak.arslan at arskom.com.tr Thu Jul 28 10:32:05 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 28 Jul 2011 11:32:05 +0300 Subject: [Soap-Python] XMLAttribute ignored in ClassModelBase.from_xml() In-Reply-To: <20110727191546.23a42256@ac1d> References: <20110727191546.23a42256@ac1d> Message-ID: <4E311E85.3080608@arskom.com.tr> On 07/27/11 20:15, Tsah Zelenka wrote: > Hello, > > It seem that if a complexType is send to soaplib its attributes are not > processed. In from_xml(), the method has a main loop itering over > the xml element's childrens and ignore the attributes. Here is a small > fix, with limited support for integer/long attributes : > https://github.com/tzelen/soaplib/commit/2e7baa903091a3e59e17ed7d7cca797636f85640 Hi Tsah, Thank you for submitting this patch. However, I can't accept it as it is for two reasons: First, you should provide us with a test case. And second, you should do something along the lines of this: inst.Attributes.attr = cls.Attributes.attr.from_string(elt.attrs['attr']) # (where cls is the class definition, inst its instance and elt # is the correspondng lxml.etree._Element instance) instead of using if's to test for variable types. That said, if you could provide us just with the test case, I can fix this bug in a way that'd please everybody. Best Regards, Burak