Ya he trabajado esto en php. Aquí está mi código de trabajo:
$request = array( 'DomainNames' => $domain_names ); $response = dreamScapeAPI('DomainCheck', $request); $available = false; $alt_domains = array(); // Alternative to user's expected domain names if (!is_soap_fault($response)) { // Successfully checked the availability of the domains if (isset($response->APIResponse->AvailabilityList)) { $availabilityList = $response->APIResponse->AvailabilityList; foreach ($availabilityList as $list) { if ($list->Available){ if ($domain == $list->Item) { $available = true; // user prefered domain found } else { $alt_domains[] = $list->Item; } } } } else { $error = $response->APIResponse->Errors; foreach ($error as $e) { $api_error = $e->Message; //echo $e->Item . ' - ' . $e->Message . '<br />'; } } } function dreamScapeAPI($method, $data = null) { $reseller_api_soap_client = ""; $soap_location = 'http://soap.secureapi.com.au/API-2.1'; $wsdl_location = 'http://soap.secureapi.com.au/wsdl/API-2.1.wsdl'; $authenticate = array(); $authenticate['AuthenticateRequest'] = array(); $authenticate['AuthenticateRequest']['ResellerID'] = '**'; $authenticate['AuthenticateRequest']['APIKey'] = '**'; //convert $authenticate to a soap variable $authenticate['AuthenticateRequest'] = new SoapVar($authenticate['AuthenticateRequest'], SOAP_ENC_OBJECT); $authenticate = new SoapVar($authenticate, SOAP_ENC_OBJECT); $header = new SoapHeader($soap_location, 'Authenticate', $authenticate, false); $reseller_api_soap_client = new SoapClient($wsdl_location, array('soap_version' => SOAP_1_2, 'cache_wsdl' => WSDL_CACHE_NONE)); $reseller_api_soap_client->__setSoapHeaders(array($header)); $prepared_data = $data != null ? array($data) : array(); try { $response = $reseller_api_soap_client->__soapCall($method, $prepared_data); } catch (SoapFault $response) { } return $response; }Probé con esto: https://github.com/dan-power/node-dreamscape
Pero la búsqueda de dominio no puede funcionar correctamente. Principalmente, lo quiero en nodejs usando nodejs dreamscape api pero este método no está disponible en nodejs.
Aquí está mi demostración de trabajo: haga clic aquí