EPP commands using XML and PHP

662 Views Asked by At

I'm trying to get a basic script working to send the standard greeting to my hosting company's EPP service.

I've read a number of articles already - Connecting to domain registry EPP server Connect to EPP Server with PHP, using SSL?

Unfortunately they don't help me, as my understanding is limited.

My hosting company provide some information on accessing the service at http://api.heartinternet.co.uk/api2.html.

They also provide an includes file which I have temporarily saved at thisismatt.co.uk/api.inc

I'm now simply trying to get the Hello command to work using the following -

<?php

require_once('api.inc');
$hi_api = new HeartInternet_API();
$hi_api->connect(false); // true = connect to the test API, false = connect to the live API.  
$username = "87bd83a452af36ba";
$password = "Q9oSjZchY8";
$hi_api->logIn($username, $password, $objects, $extensions);

$some_xml = <<<XML


<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <hello />
</epp> 



XML;

$returned_xml = $hi_api->sendMessage($some_xml, true);

echo "XML Sent: <br />" . htmlentities($some_xml) . "<br />";
echo "XML Received: <br /> " . htmlentities($returned_xml) . "<br />";

?>

I keep getting 500 server error. What's gone wrong?

1

There are 1 best solutions below

0
On

Various points :

  • thisismatt.co.uk/api.inc gives a 404
  • I suppose HeartInternet_API is defined in it, but in any case you should test the result of each call, that is after new, connect and logIn (double check the case)
  • you should investigate what this 500 error is, you probably have more information in your logfiles
  • i hope you did not give true username & password here :-(
  • in your XML exchange, try to have on first line <?xml version="1.0"?> the parser may expect that there