-1

I am trying to connect epp and submitting xml but it returns nothing except 'server connected'.

$xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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">
  <hello />
</epp>';


$output = '';

$fp = fsockopen("epp.host.com", 44, $errno, $errstr);
if(!$fp) {
    echo "ERROR: $errno - $errstr<br />\n";
} 
else{
    echo "epp connected\r\n";
    fwrite($fp, $xml."\r\n");
    while(!feof($fp)){
        $output .= fgets($fp, 128);
    }
    fclose($fp);
}

$result = strtok($output, "\n");

echo $result;

Can you please suggest about what i am missing in this code to resolve this. Thanks

seoppc
  • 2,766
  • 7
  • 44
  • 76

1 Answers1

0

You do not give enough information. EPP does not work like that, you are missing at least two points :

  1. EPP needs TLS, so you need to establish your TLS connection (with certificates) before doing anything else
  2. The first party to speak in EPP is the server, sending a greeting node to the client; as a client you should read it (it contains useful information) and then reply.
Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54