[Twisted-Python] Twisted and SOAP
![](https://secure.gravatar.com/avatar/5afc738b609bc29d0ac60b3b91a8dd81.jpg?s=120&d=mm&r=g)
Hi, What is currently the recommended option for letting Twisted applications communicate with SOAP services? Cheers, Einar
![](https://secure.gravatar.com/avatar/5afc738b609bc29d0ac60b3b91a8dd81.jpg?s=120&d=mm&r=g)
Well, at least I've found that the interest in SOAP in the Twisted community is not very great ;) And understandably so. Unfortunately, however, sometimes Twisted apps do need to talk to alternative protocols, so it is a pity there's no recommended way of doing this. For future reference: I ended up using suds with the following wrapper provided to this list in April by Landreville. It seems to be working great, so thanks Landreville :) """ Wrapper for suds to create deferred instances. """ from suds.client import Client as SudsClient from twisted.internet.threads import deferToThread class Client(SudsClient): # method for returning a deferred for the RPC def callRemote(self, method, *args, **kwargs): def call(m, *a, **kw): result = self.service.__getattr__(m)(*a, **kw) return result d = deferToThread(call, method, *args, **kwargs) return d Cheers, Einar On Thu, Aug 26, 2010 at 12:15 PM, Einar S. Idsø <einar.twisted@norsk-esport.no> wrote:
![](https://secure.gravatar.com/avatar/f48cdf7f95adb87034f78f44d46cc785.jpg?s=120&d=mm&r=g)
On Wed, Sep 1, 2010 at 1:16 AM, Einar S. Idsø <einar.twisted@norsk-esport.no> wrote:
That's pretty much what I did as well. There is twisted.web.soap, but it uses SOAPpy which is awful -- Suds is much better. If you take a look at its insides though you can see how they are turning it into a deferred in a better way than just deferToThread.
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Sep 1, 2010, at 1:16 AM, Einar S. Idsø wrote:
If you want there to be a "recommended way", you can be the one to make the recommendation. The lack of interest in SOAP in the Twisted community is a self-fulfilling prophecy: since there isn't much SOAP support, we don't have a lot of SOAP people come around, and since we don't have very many SOAP people, we don't have much in the way of SOAP support. If you would like to change this, please feel free to either contribute patches to Twisted web's SOAP support, or to start a txsoap (or txwsstar, or whatever makes sense in your context). We'd love to have someone active in maintaining these sorts of protocols, since Twisted is really only as good as the protocol implementations that you need it to talk to.
![](https://secure.gravatar.com/avatar/5afc738b609bc29d0ac60b3b91a8dd81.jpg?s=120&d=mm&r=g)
On Wed, Sep 1, 2010 at 5:58 PM, Landreville <landreville@deadtreepages.com> wrote:
On Wed, Sep 1, 2010 at 11:47 PM, Glyph Lefkowitz <glyph@twistedmatrix.com> wrote:
I suppose you can call my reiteration of Landreville's solution my recommendation. If not based on any extensive experience with Twisted in any way, then at least based on me finding a solution that works for me :) Unfortunately, the level of Twisted sophistication I'm currently at, and also my current requirements for my application, which only needs to do a couple of SOAP-calls because of one of the services it interfaces to, leads me to simply having to find a solution that "just works" rather than develop a better one than what can be currently done with solutions such as the one mentioned. Anyways: My application performs the SOAP calls nicely now, and I have moved on to other issues. Such as the persistent obscurity of inheritance versus interfaces and adapters. For a guy that has no experience in object-oriented programming, Twisted has a rather steep learning-curve. But I'm getting there, thanks to both this list and the community at large. Cheers, Einar
![](https://secure.gravatar.com/avatar/5afc738b609bc29d0ac60b3b91a8dd81.jpg?s=120&d=mm&r=g)
Well, at least I've found that the interest in SOAP in the Twisted community is not very great ;) And understandably so. Unfortunately, however, sometimes Twisted apps do need to talk to alternative protocols, so it is a pity there's no recommended way of doing this. For future reference: I ended up using suds with the following wrapper provided to this list in April by Landreville. It seems to be working great, so thanks Landreville :) """ Wrapper for suds to create deferred instances. """ from suds.client import Client as SudsClient from twisted.internet.threads import deferToThread class Client(SudsClient): # method for returning a deferred for the RPC def callRemote(self, method, *args, **kwargs): def call(m, *a, **kw): result = self.service.__getattr__(m)(*a, **kw) return result d = deferToThread(call, method, *args, **kwargs) return d Cheers, Einar On Thu, Aug 26, 2010 at 12:15 PM, Einar S. Idsø <einar.twisted@norsk-esport.no> wrote:
![](https://secure.gravatar.com/avatar/f48cdf7f95adb87034f78f44d46cc785.jpg?s=120&d=mm&r=g)
On Wed, Sep 1, 2010 at 1:16 AM, Einar S. Idsø <einar.twisted@norsk-esport.no> wrote:
That's pretty much what I did as well. There is twisted.web.soap, but it uses SOAPpy which is awful -- Suds is much better. If you take a look at its insides though you can see how they are turning it into a deferred in a better way than just deferToThread.
![](https://secure.gravatar.com/avatar/e1554622707bedd9202884900430b838.jpg?s=120&d=mm&r=g)
On Sep 1, 2010, at 1:16 AM, Einar S. Idsø wrote:
If you want there to be a "recommended way", you can be the one to make the recommendation. The lack of interest in SOAP in the Twisted community is a self-fulfilling prophecy: since there isn't much SOAP support, we don't have a lot of SOAP people come around, and since we don't have very many SOAP people, we don't have much in the way of SOAP support. If you would like to change this, please feel free to either contribute patches to Twisted web's SOAP support, or to start a txsoap (or txwsstar, or whatever makes sense in your context). We'd love to have someone active in maintaining these sorts of protocols, since Twisted is really only as good as the protocol implementations that you need it to talk to.
![](https://secure.gravatar.com/avatar/5afc738b609bc29d0ac60b3b91a8dd81.jpg?s=120&d=mm&r=g)
On Wed, Sep 1, 2010 at 5:58 PM, Landreville <landreville@deadtreepages.com> wrote:
On Wed, Sep 1, 2010 at 11:47 PM, Glyph Lefkowitz <glyph@twistedmatrix.com> wrote:
I suppose you can call my reiteration of Landreville's solution my recommendation. If not based on any extensive experience with Twisted in any way, then at least based on me finding a solution that works for me :) Unfortunately, the level of Twisted sophistication I'm currently at, and also my current requirements for my application, which only needs to do a couple of SOAP-calls because of one of the services it interfaces to, leads me to simply having to find a solution that "just works" rather than develop a better one than what can be currently done with solutions such as the one mentioned. Anyways: My application performs the SOAP calls nicely now, and I have moved on to other issues. Such as the persistent obscurity of inheritance versus interfaces and adapters. For a guy that has no experience in object-oriented programming, Twisted has a rather steep learning-curve. But I'm getting there, thanks to both this list and the community at large. Cheers, Einar
participants (4)
-
Einar S. Idsø
-
Glyph Lefkowitz
-
Itamar Turner-Trauring
-
Landreville