Hi,

this is a patch for "HTTP error: no proper separation of headers and document".
I've faced with a problem when receiving HTTP headers as following:
//************************* HTTP headers
HTTP/1.0 200 Connection established
Proxy-Agent: NetCache NetApp/6.1.1

HTTP/1.0 401 Unauthorized
Content-Type: text/xml; charset=UTF-8
WWW-Authenticate: Basic realm=
X-Backside-Transport: FAIL FAIL
Connection: close
//************************* HTTP headers

I got an error from nusoap: "HTTP error: no proper separation of headers and document". Looking in the code, I realized that both 200 and 401 were removed (see isSkippableCurlHeader in nusoap.php).

So please find hereafter a suggestion of patch (note that it surely can be improved, but for my needs, it's OK).

//*************************** CODE
      // Patch part 1
      $atleastoneskipped = false;
      $textxmlcontenttype = false;

      if( eregi( "Content-Type: text/xml", $data )) {
        $textxmlcontenttype = true;
      }
      // \ Patch part 1

      while ($this->isSkippableCurlHeader($data)) {
// Patch Part 2
        $atleastoneskipped = true;
// \ Patch Part 2
        $this->debug("Found HTTP header to skip");
        if ($pos = strpos($data,"\r\n\r\n")) {
          $data = ltrim(substr($data,$pos));
        } elseif($pos = strpos($data,"\n\n") ) {
          $data = ltrim(substr($data,$pos));
        }
      }

      if ($data == '') {
        // have nothing left; just remove 100 header(s)
        $data = $savedata;
        while (ereg('^HTTP/1.1 100',$data)) {
          if ($pos = strpos($data,"\r\n\r\n")) {
            $data = ltrim(substr($data,$pos));
          } elseif($pos = strpos($data,"\n\n") ) {
            $data = ltrim(substr($data,$pos));
          }
        }
      }

      // Patch part 3
      if ($textxmlcontenttype && $atleastoneskipped && !$pos = strpos($data,"\r\n\r\n") && !$pos = strpos($data,"\n\n")) {
        $contenttype = "Content-type: text/xml";
        $data = "$contenttype\n\n$data";
      }
      // \ Patch part 3

      // separate content from HTTP headers
      if ($pos = strpos($data,"\r\n\r\n")) {
        $lb = "\r\n";
//*************************** / CODE

This allows the further process to succeed and to parse the SOAP response (a SOAP exception in this case).

Regards,

Karl3i.