public static function register($name, $password, $first, $last, $email, $address, $country, $postal_code) { $client = new WSClient(array("wsdl" => "Calendar.wsdl", "useSOAP" => 1.2, "to" => "http://localhost/samples/solutions/calendar/CalendarService.php")); $proxy = $client->getProxy(); $return_val = $proxy->register(array("username" => $name, "password" => $password, "first_name" => $first, "last_name" => $last, "email" => $email, "address" => $address, "country" => $country, "postal_code" => $postal_code)); return $return_val; }
} class setPerson { public $param0; } class setPersonResponse { public $return; } // define the class map $class_map = array("anyType" => "anyType", "getPerson" => "getPerson", "getPersonResponse" => "getPersonResponse", "Person" => "Person", "base64Binary" => "base64Binary", "setPerson" => "setPerson", "setPersonResponse" => "setPersonResponse"); try { // create client in WSDL mode $client = new WSClient(array("wsdl" => "http://localhost/samples/wsdl_mode/MimeService.php?wsdl", "to" => "http://localhost/samples/wsdl_mode/MimeService.php", "classmap" => $class_map, "useMTOM" => FALSE)); // get proxy object reference form client $proxy = $client->getProxy(); // create input object and set values $input = new getPerson(); $input->param0 = 3; // call the operation $response = $proxy->getPerson($input); echo "Received Person Object values "; var_dump($response); $input = new setPerson(); $ppl = new Person(); $ppl->age = 3; $bin1 = new base64Binary(); $bin1->contentType = "image/jpeg"; $bin1->value = "xxxxx"; $bin2 = new base64Binary(); $bin2->contentType = "image/jpeg";
public static function getNodesByDuration($input) { try { //TODO: fill $input with (data type: anyType) data to match your business logic // call the operation // create a private client and proxy in WSDL mode $client = new WSClient(array("wsdl" => "DrupalAPI.wsdl", "classmap" => DrupalAPIClient::$class_map)); $proxy = $client->getProxy(); $response = $proxy->getNodesByDuration($input); //TODO: Implement business logic to consume $response, which is of type getNodesResponse return $response; } catch (Exception $e) { // in case of an error, process the fault if ($e instanceof WSFault) { printf("Soap Fault: %s\n", $e->Reason); } else { printf("Message = %s\n", $e->getMessage()); } } }
public static function register($name, $password, $first, $last, $email, $address, $country, $postal_code) { // we need to create a static function for the register, since it doesn't need any signed in $client = new WSClient(array("wsdl" => "Calendar.wsdl", "classmap" => CalendarClient::getClassmap(), "to" => self::ENDPOINT)); $proxy = $client->getProxy(); $return_val = $proxy->register(array("username" => $name, "password" => $password, "firstName" => $first, "lastName" => $last, "email" => $email, "address" => $address, "country" => $country, "postalCode" => $postal_code)); return $return_val; }