POST from Zope to external server and receive RESPONSE
Hello folks, I'm sure this question has been answered before but bear with me - Zope isn't my forte and I couldn't see anything like the problem I'd like to solve on the Zope list. I've inherited a project that now needs to post an XML packet to an ecommerce gateway, ie a user submits, via a form, credit card details which are posted to a Zope server. The Zope server then builds an XML packet and wants to POST to an external server which will send a RESPONSE. Can I capture that RESPONSE in Zope or must I use external methods and something like Python's httplib. I've done similar things with curl lib and C++, php curl lib and php. Any hints folks? David
David@Sidach wrote:
Hello folks,
I'm sure this question has been answered before but bear with me - Zope isn't my forte and I couldn't see anything like the problem I'd like to solve on the Zope list.
I've inherited a project that now needs to post an XML packet to an ecommerce gateway, ie a user submits, via a form, credit card details which are posted to a Zope server. The Zope server then builds an XML packet and wants to POST to an external server which will send a RESPONSE.
Can I capture that RESPONSE in Zope or must I use external methods and something like Python's httplib.
I've done similar things with curl lib and C++, php curl lib and php.
Any hints folks?
I am pretty sure XMLRPCMethod http://www.zope.org/Members/EIONET/XMLRPC will help you with that. Michael -- http://zope.org/Members/d2m http://planetzope.org
On Thu, Sep 28, 2006 at 10:42:18PM +1000, David@Sidach wrote:
I've inherited a project that now needs to post an XML packet to an ecommerce gateway, ie a user submits, via a form, credit card details which are posted to a Zope server. The Zope server then builds an XML packet and wants to POST to an external server which will send a RESPONSE.
Can I capture that RESPONSE in Zope or must I use external methods and something like Python's httplib.
I've done similar things with curl lib and C++, php curl lib and php.
Any hints folks?
You'll need to use an external method (or write a simple product). Then you can use httplib or urllib2, or the python wrappers for curl (I found curl worked in some weird firewall configurations that httplib didn't). But you mention XML. If the remote system is XML-RPC, you'll want to use python's excellent xmlrpclib, which makes rpc calls look just like local calls: remote = xmlrpclib.ServerProxy('http://somewhere/something') result = remote.someMethod('param1', 'param2') -- Paul Winkler http://www.slinkp.com
participants (3)
-
David@Sidach -
Michael Haubenwallner -
Paul Winkler