Patch for gSOAP

Kervala
2010-10-04
2013-06-06
  • Kervala

    Kervala - 2010-10-04

    Hi,

    I'm using gSOAP on server side and nusoap on client side.

    It never worked without modifying nusoap code.

    gSOAP is using application/soap+xml as content-type while nusoap only accepts text/xml.

    Here is a patch, could you apply it please ? Thanks.

    --- E:/Download/nusoap-0.9.5/lib/nusoap.php Mon Apr 26 22:38:08 2010
    +++ D:/Neolinks/web/hopi/trunk/nusoap/nusoap.php    Mon Oct 04 15:03:13 2010
    @@ -7654,8 +7654,8 @@
                $this->setError('Response not of type text/xml (no content-type header)');
                return false;
            }
    -       if (!strstr($headers['content-type'], 'text/xml')) {
    -           $this->setError('Response not of type text/xml: ' . $headers['content-type']);
    +       if (!strstr($headers['content-type'], 'text/xml') && !strstr($headers['content-type'], 'application/soap+xml')) {
    +           $this->setError('Response not of type text/xml or application/soap+xml: ' . $headers['content-type']);
                return false;
            }
            if (strpos($headers['content-type'], '=')) {
    

    And in my code, I need to add these lines to modify default namespaces, else gSOAP server doesn't work and return a VERSION MISMATCH error:

    $soap = new nusoap_client(new wsdl($url), true);
    $soap->namespaces['SOAP-ENV'] = 'http://www.w3.org/2003/05/soap-envelope';
    $soap->namespaces['SOAP-ENC'] = 'http://www.w3.org/2003/05/soap-encoding';
    $soap->namespaces['xop'] = 'http://www.w3.org/2004/08/xop/include';
    $soap->namespaces['xmime4'] = 'http://www.w3.org/2004/11/xmlmime';
    
     
  • Kervala

    Kervala - 2010-10-04

    I found and fixed another bug where an infinite loop was crashing PHP:

    --- E:/Download/nusoap-0.9.5/lib/nusoap.php Mon Apr 26 22:38:08 2010
    +++ D:/Neolinks/web/hopi/trunk/nusoap/nusoap.php    Mon Oct 04 15:20:06 2010
    @@ -1828,6 +1828,8 @@
                    }
                }
                return $this->simpleTypes[$type];
    +       } elseif(!$is_element){
    +           // to fix an infinite loop
            } elseif(isset($this->elements[$type])){
                $this->xdebug("in getTypeDef, found element $type");
                if (!isset($this->elements[$type]['phpType'])) {
    
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks