PHP 5 Classes CreateOrder - Nameserver_Update

Replaces the nameserver with a new handle. There are 2 ways to submit the new Nameserver:

  • Submit a Handle-ID. The handle linked to the domain will be replaced
  • Submit new data. A new handle will be created. The handle linked to the domain will be replaced

With the Nameserver Update, it is possible to change Tech Contact, DnsSec and Nameservers in one request.

For .com, .net and some other TLDs glue records are needed. Please contact support for help.

Response CreateOrder(string $sessionId,Order $order)

Response codes

ResultCodeMessageValue
200Order validated
200Order received
400Order not validatedMessages
401Authorization failed
405Access denied

CreateOrder request

PropertyDescription
sessionIdExample: o58t9fjgw9bjarp6q7byv13e
order

CreateOrderResponse

Property
CreateOrderResult
order

PHP 5 Classes example

<?php
namespace ascio\v2\examples;
require("../service/autoload.php");
require("../../lib/AscioConfig.php");
use ascio\v2 as ascio;
use ascio\lib as lib;
function nameserver_UpdateExample() {
	$config = new lib\Config();
	$env = $config->get("testing"); //testing or live
	$sessionId = "12345";
	$ascioClient	 = new ascio\AscioServices(array("trace" => true),$env->getWsdl("v2"));

	$nameServer1 =  new ascio\NameServer();
	$nameServer1->setHostName("ns1.ascio.net");

	$nameServer2 =  new ascio\NameServer();
	$nameServer2->setHostName("ns2.ascio.net");

	$nameServers =  new ascio\NameServers();
	$nameServers->setNameServer1($nameServer1);
	$nameServers->setNameServer2($nameServer2);

	$domain =  new ascio\Domain();
	$domain->setDomainName($env->getProperties()->getProperty("DomainName"));
	$domain->setNameServers($nameServers);

	$order =  new ascio\Order();
	$order->setType(ascio\OrderType::Nameserver_Update);
	$order->setDomain($domain);
	echo "start validate\n";
	$validateOrder = new  ascio\ValidateOrder($sessionId, $order);
	try {
		$response = $ascioClient->ValidateOrder($validateOrder);
	} catch (\Exception $e) {
		echo ("[".$e->faultcode . "] ". $e->faultstring);
		return;
	}
	echo "end validate\n";
	
	if ($response->ValidateOrderResult->getResultCode() == 200) {
		echo "Validation: OK\r\n";
		try {
			$createOrderResponse = $ascioClient->CreateOrder(new ascio\CreateOrder($sessionId, $order));
		} catch (\Exception $e) {
			echo ("[".$e->faultcode . "] ". $e->faultstring);
			return;
		}
		echo "Create Order: ".$createOrderResponse->CreateOrderResult->getResultCode() . " " . $createOrderResponse->CreateOrderResult->getResultMessage() . "\r\n";
		if ($createOrderResponse->CreateOrderResult->getResultCode() == 200) {
			echo "OrderId : " . $createOrderResponse->CreateOrderResult->getOrderInfo()->getOrderId() . "\r\n";
			echo "Order Status : " . $createOrderResponse->CreateOrderResult->getOrderInfo()->getStatus() . "\r\n";
		} else {
			echo ($response->CreateOrderResult->getMessage()."\n");
			foreach($createOrderResponse->CreateOrderResult->getErrors() as $error) {
				echo $error."\n";
				return $response;
			}
		}
		return $createOrderResponse;
	} else {
		echo ($response->ValidateOrderResult->getMessage()."\n");
		if ($response->ValidateOrderResult->getErrors()) {
			foreach($response->ValidateOrderResult->getErrors()->getString() as $error) {
				 echo $error."\n";
			}
		}
		return $response;
	}
}
nameserver_UpdateExample();
WSDL for AWS v2
https://aws.demo.ascio.com/2012/01/01/AscioService.wsdl (OTE)
https://aws.ascio.com/2012/01/01/AscioService.wsdl (Live)