Connecting to an epp server
| From: | Alan Willsher | Date: | Wed, 09 Apr 2008 21:49:29 +0000 |
| Subject: | Connecting to an epp server | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-272810@lists.php.net to get a copy of this message | ||
Hi im trying to connect to Nominets EPP server
Details can be found here http://www.nominet.org.uk/registrars/systems/epp/
Im trying to send a login request the example can be found here
http://www.nominet.org.uk/registrars/systems/epp/login/
My script seems to connect ok, but im recieving no response when I try to
send the login xml details.
<?
$fp = @fsockopen('ssl://testbed-epp.nominet.org.uk', 700, $errno, $errstr,
100);
echo "(".$errno." ".$errstr.")";
if(!$fp) {
echo "Not Connected!";
}
else {
echo "Connected!\r\n";
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<command>
<login>
<clID>EXAMPLE-TAG</clID>
<pw>foo-BAR2</pw>
<options>
<version>1.0</version>
<lang>en</lang>
</options>
<svcs>
<objURI>http://www.nominet.org.uk/epp/xml/nom-account-1.0
</objURI>
<objURI>http://www.nominet.org.uk/epp/xml/nom-domain-1.0</objURI>
<objURI>http://www.nominet.org.uk/epp/xml/nom-contact-1.0
</objURI>
<objURI>http://www.nominet.org.uk/epp/xml/nom-ns-1.0</objURI>
</svcs>
</login>
<clTRID>ABC-12345</clTRID>
</command>
</epp>';
fputs($fp, $xml, strlen($xml));
while (!feof($fp)) {
$response .= fgets($fp, 128);
}
echo $response;
fclose($fp);
}
?>