EPP 调用在 xml 发布时返回空值


EPP call is returning empty value on xml post

>我正在尝试连接 epp 并提交 xml,但它除了"服务器已连接"之外什么都不返回。

$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;

您能否建议我在此代码中缺少什么来解决此问题。谢谢

你没有提供足够的信息。EPP不是那样工作的,你至少错过了两点:

  1. EPP 需要 TLS,因此您需要在执行任何其他操作之前建立 TLS 连接(使用证书)
  2. 在 EPP 中说话的第一方是服务器,向客户端发送一个greeting节点;作为客户端,您应该阅读它(它包含有用的信息),然后回复。