[Zope] Best approach for SOAP

Antonio Beamud Montero antonio.beamud@agora-2000.com
17 Mar 2003 18:31:40 +0100


--=-4LzdDfEx6uGEqejPicbh
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

Hi again:
I have fixed the Petru Paler patch. I have tested it on Zope-2.5.0.
and works fine...
My patch is attached.
If someone test this patch with zope-2.6, please notify me.

Bye.

----------
Antonio Beamud Montero <antonio.beamud@wanadoo.es>


El lun, 17 de 03 de 2003 a las 14:44, Antonio Beamud Montero escribis:
> Hi all:
> What's the best approach to offer services using SOAP?
> I have read about the Petru Paler patch
> (http://www.ppetru.net/software/soap-cvs.diff) and about ZSI.
> If I go by the way of ZSI, I need to implement an XML-RPC <-> SOAP
> gateway?
> Can anybody help me?
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

--=-4LzdDfEx6uGEqejPicbh
Content-Disposition: attachment; filename=zope-2.5.0-soap.diff
Content-Type: text/x-patch; name=zope-2.5.0-soap.diff; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

diff -urN zope/lib/python/ZPublisher/HTTPRequest.py zope-mod/lib/python/ZPublisher/HTTPRequest.py
--- zope/lib/python/ZPublisher/HTTPRequest.py	Thu Jan  3 20:41:05 2002
+++ zope-mod/lib/python/ZPublisher/HTTPRequest.py	Mon Mar 17 18:20:43 2003
@@ -21,6 +21,7 @@
 from Converters import get_converter
 from maybe_lock import allocate_lock
 xmlrpc=None # Placeholder for module that we'll import if we have to.
+soap=None
 
 #cgi hotfix:
 if not hasattr(cgi, 'valid_boundary'):
@@ -347,18 +348,28 @@
         meth=None
         fs=FieldStorage(fp=fp,environ=environ,keep_blank_values=1)
         if not hasattr(fs,'list') or fs.list is None:
-            # Hm, maybe it's an XML-RPC
-            if (fs.headers.has_key('content-type') and
-                fs.headers['content-type'] == 'text/xml' and
+            # Hm, maybe it's an XML-RPC or SOAP
+	    if (fs.headers.has_key('content-type') and
+                fs.headers['content-type'][:8] == 'text/xml' and
                 method == 'POST'):
-                # Ye haaa, XML-RPC!
-                global xmlrpc
-                if xmlrpc is None: import xmlrpc
-                meth, self.args = xmlrpc.parse_input(fs.value)
-                response=xmlrpc.response(response)
-                other['RESPONSE']=self.response=response
-                other['REQUEST_METHOD']='' # We don't want index_html!
-                self.maybe_webdav_client = 0
+              if environ.has_key('HTTP_SOAPACTION'):
+                  # this is a SOAP request
+                  global soap
+                  if soap is None:
+                          import soap
+                  meth, self.args = soap.parse_input(fs.value)
+                  response = soap.response(response)
+                  other['RESPONSE'] = self.response = response
+                  other['REQUEST_METHOD'] = ''
+              else:
+	          # Ye haaa, XML-RPC!
+	          global xmlrpc
+	          if xmlrpc is None: import xmlrpc
+	          meth, self.args = xmlrpc.parse_input(fs.value)
+	          response=xmlrpc.response(response)
+	          other['RESPONSE']=self.response=response
+	          other['REQUEST_METHOD']='' # We don't want index_html!
+                  self.maybe_webdav_client = 0
             else:
                 self._file=fs.file
         else:
File zope/var/pcgi.soc is a socket while file zope-mod/var/pcgi.soc is a socket

--=-4LzdDfEx6uGEqejPicbh--