Example #1
0
function get_marsupial_ws_client($publisher, $auth_content = false)
{
    // This call must be included to ensure the WSDL loading
    libxml_disable_entity_loader(false);
    $debugging = debugging();
    $tracer = get_config('rcommon', 'tracer');
    $debugging = $debugging || $tracer == 'checked';
    if ($debugging) {
        ini_set('soap.wsdl_cache', WSDL_CACHE_NONE);
    }
    $wsdl = $auth_content ? $publisher->urlwsauthentication : $publisher->urlwsbookstructure;
    $options = get_marsupial_soap_options($debugging);
    $client = @new soapclient($wsdl . '?wsdl', $options);
    $auth = array('User' => $publisher->username, 'Password' => $publisher->password);
    $namespace = rcommon_get_wsdl_namespace($wsdl . '?wsdl');
    $header = new SoapHeader($namespace, "WSEAuthenticateHeader", $auth);
    $client->__setSoapHeaders(array($header));
    return $client;
}
        if ($param === false || $param === "") {
            unset($params->Detalles->{$key});
        }
    }
    $params_arr = (array) $params;
    foreach ($params_arr as $key => $param) {
        if ($param === false || $param === "") {
            unset($params->{$key});
        }
    }
    try {
        print_object($params);
        if ($ws) {
            $wsdl = $CFG->wwwroot . '/mod/rcontent/WebServices/wsSeguimiento.php';
            ini_set('soap.wsdl_cache_enabled', '0');
            $options = array('connection_timeout' => 120);
            $options['trace'] = 1;
            $client = @new soapclient($wsdl . '?wsdl', $options);
            $auth = array('User' => $User, 'Password' => $Password);
            $namespace = rcommon_get_wsdl_namespace($wsdl . '?wsdl');
            $header = new SoapHeader($namespace, "WSEAuthenticateHeader", $auth);
            $client->__setSoapHeaders(array($header));
            $return = $client->ResultadoDetalleExtendido($params);
        } else {
            $return = get_ResultadoDetalleExtendido($params);
        }
        print_object($return);
    } catch (Exception $e) {
        print_object($e);
    }
}