[Zope] SOAP - Integration?

rieh25 robertoedwins at gmail.com
Wed Aug 8 16:23:42 EDT 2007


External method for Zope 2.7.5

import sys, httplib

def envia_mensaje(m):

  #construct and send the header


  if m['tipo'] == 'HTTP': webservice = httplib.HTTP(m['pagina'], 80)
  elif m['tipo'] == 'HTTPS': webservice = httplib.HTTPS(m['pagina'], 443)
  webservice.putrequest("POST", m['post'])
  webservice.putheader("Host", m['host'])
  webservice.putheader("Content-type", m['content-type'])
  webservice.putheader("Content-length", "%d" % len(m['mensaje']))
  webservice.putheader("SOAPAction", m['SOAPAction'])


  webservice.endheaders()

  webservice.send(m['mensaje'])

  # get the response

  statuscode, statusmessage, header = webservice.getreply()

  r = {}
  r['Response'] = {'statuscode': statuscode, 'statusmessage': statusmessage}
  r['header'] = header
  r['res'] = webservice.getfile().read()
  return r
-- 
View this message in context: http://www.nabble.com/SOAP---Integration--tf4211042.html#a12061157
Sent from the Zope - General mailing list archive at Nabble.com.



More information about the Zope mailing list