Exemple #1
0
function xmlrpc_SearchCustomers($xmlrpcmsg)
{
    return new xmlrpcresp(php_xmlrpc_encode(SearchCustomers($xmlrpcmsg->getParam(0)->scalarval(), $xmlrpcmsg->getParam(1)->scalarval(), $xmlrpcmsg->getParam(2)->scalarval(), $xmlrpcmsg->getParam(3)->scalarval())));
}
Exemple #2
0
function xmlrpc_SearchCustomers($xmlrpcmsg)
{
    ob_start('ob_file_callback');
    /*x*/
    if ($xmlrpcmsg->getNumParams() == 4) {
        /*x*/
        $rtn = new xmlrpcresp(php_xmlrpc_encode(SearchCustomers($xmlrpcmsg->getParam(0)->scalarval(), $xmlrpcmsg->getParam(1)->scalarval(), $xmlrpcmsg->getParam(2)->scalarval(), $xmlrpcmsg->getParam(3)->scalarval())));
        /*x*/
    } else {
        $rtn = new xmlrpcresp(php_xmlrpc_encode(SearchCustomers($xmlrpcmsg->getParam(0)->scalarval(), $xmlrpcmsg->getParam(1)->scalarval(), '', '')));
        /*x*/
    }
    ob_end_flush();
    return $rtn;
}
    $dateRange->MinDate = "";
    // yyyyMMdd
    // Specify whether the returned Customer list should be sorted by customer
    // name, number, or identifier.
    // You should only specify one OrderBy element in the array.
    // Additional array items, if specified will be ignored by the service.
    $ordering = new OrderBy();
    $ordering->Field = OrderByField::Number;
    $ordering->Order = SortOrder::Ascending;
    // Given the user credentials authenticated above, search for customers by UserName.
    $predicate = new Predicate();
    $predicate->Field = "UserName";
    $predicate->Operator = PredicateOperator::Equals;
    $predicate->Value = $user->UserName;
    // Search for customers that match the specified criteria.
    $customers = SearchCustomers($dateRange, array($ordering), $pageInfo, array($predicate));
    printf("Customer search results by UserName (%s):\n\n", $user->UserName);
    PrintCustomers($customers);
} catch (SoapFault $e) {
    // Output the last request/response.
    print "\nLast SOAP request/response:\n";
    print $GLOBALS['proxy']->GetWsdl() . "\n";
    print $GLOBALS['proxy']->GetService()->__getLastRequest() . "\n";
    print $GLOBALS['proxy']->GetService()->__getLastResponse() . "\n";
    // Customer Management service operations can throw AdApiFaultDetail.
    if (isset($e->detail->AdApiFaultDetail)) {
        // Log this fault.
        print "The operation failed with the following faults:\n";
        $errors = is_array($e->detail->AdApiFaultDetail->Errors->AdApiError) ? $e->detail->AdApiFaultDetail->Errors->AdApiError : array('AdApiError' => $e->detail->AdApiFaultDetail->Errors->AdApiError);
        // If the AdApiError array is not null, the following are examples of error codes that may be found.
        foreach ($errors as $error) {