WebDav SEARCH question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • doug

    WebDav SEARCH question

    I have a HTTP_Request webdav query against exchange that just isnt
    working I have tried everything, the webdav query is correctly
    formatted, my header or something must be incorrect, I have used the
    same query with the tool


    and it works but with my code below it does not? The headers appear to
    be identical, and my code below works with a PROPFIND Query fine, but
    a SEARCH query consistently comes back with a result code of 400.

    The PHP Code to generate my query is:

    include "HTTP/Request.php";
    $query='<?xml version="1.0"?>
    <D:searchreques t xmlns:D="DAV:">
    <D:sql>
    SELECT "DAV:displaynam e", "DAV:contentcla ss"
    FROM "https://webmail.test.co m/exchange/"
    WHERE "DAV:isfold er" = true
    </D:sql>
    </D:searchrequest >
    ';

    $username='test ';
    $password='test ';

    $req = &new HTTP_Request("h ttps://webmail.test.co m/exchange/");


    $req->setMethod('SEA RCH');

    $req->setBasicAuth($ username, @$password);

    $req->addHeader('Use r-Agent', 'Exchange Admin');
    $req->addHeader("Con tent-Type", "text/xml");
    $req->addHeader('dep th','0');
    $req->addHeader('tra nslate','f');
    $req->addHeader('Con nection','Keep-Alive');

    $req->addRawPostData ($query);
    $req->sendRequest( );
    echo $req->getResponseHea der();
    echo $req->getResponseBod y();

  • doug

    #2
    Re: WebDav SEARCH question

    This turns out to be a PEAR PHP problem... There is a bug in
    HTTP_Request

    Comment

    Working...