Documentation

IWebService::TestComponent

void
IWebService::TestComponent();

The method TestComponent runs a series of tests using a SOAP client. This method is called in the public section of a web service.


class CCheckAuthWS extends IWebService
{
    ...
    
    function TestComponent() 
    {
        global $APPLICATION;
        $client = new CSOAPClient("bitrix.soap", $APPLICATION->GetCurPage());

        // HTTP Authorization required by GetHTTPUserInfo method
        $client->setLogin("admin");
        $client->setPassword("123456");
        $request = new CSOAPRequest("GetHTTPUserInfo", CWebService::GetDefaultTargetNS());

        //$request->addParameter("stub", 0);
        $response = $client->send( $request );
        if ($response->FaultString)
            echo $response->FaultString;
        else
            echo "Call GetHTTPUserInfo(): 
".mydump($response->Value)."
";

    }

    ...
}
© «Bitrix24», 2001-2024
Up