Re: Two SOAP Issues

From: Date: Mon, 18 Mar 2002 21:27:01 +0000
Subject: Re: Two SOAP Issues
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5029@lists.php.net to get a copy of this message
Thanks, I'll integrate the patch sometime this week, once I get back into working on this. I'm not sure if we want to decode base64Binary, or pass them through as is and let the application do the decoding. Regards, Shane Caraveo Christian Dickmann wrote:
Another Issue: The Client is not able to handle Type "base64Binary" yet. I added this to SOAP/Value.php. Do you need a diff? Just 4 lines of code.
Attached a diff to SOAP/Value.php which handels typs "int" and "base64Binary". Don't know if this change is OK, but it works fine in my test. Christian Dickmann Index: SOAP/Value.php =================================================================== RCS file: /repository/pear/SOAP/Value.php,v retrieving revision 1.16 diff -u -r1.16 Value.php --- SOAP/Value.php 11 Mar 2002 08:32:20 -0000 1.16 +++ SOAP/Value.php 18 Mar 2002 21:07:50 -0000 @@ -456,14 +456,24 @@
     function decode($soapval = false)
     {
         global $SOAP_typemap;
-        +
         if (!$soapval) {
             $soapval = $this;
         }
-        +
         $this->debug("inside SOAP_Value->decode for $soapval->name of type $soapval->type and value: $soapval->value");
         // scalar decode
         if ($soapval->type_code == SOAP_VALUE_SCALAR) {
+            if ($soapval->type == 'base64Binary')
+            {
+                $soapval->value = base64_decode($soapval->value);
+            }
+            else
+            if ($soapval->type == 'int')
+            {
+                $soapval->value = (int) $soapval->value;
+            }
+            else
             if ($soapval->type == 'boolean') {
                 #echo strcasecmp($soapval->value,'false');
                 if ($soapval->value != '0' && strcasecmp($soapval->value,'false') !=0) {
@@ -515,7 +525,7 @@
         # couldn't decode, return a fault!
         return $this->raiseSoapFault("couldn't decode response, invalid type_code");
     }
-    +
     /**
     * pass it a type, and it attempts to return a namespace uri
     *


« previous php.pear.dev (#5029) next »