【问题标题】:EPP call is returning empty value on xml postEPP 调用在 xml 帖子上返回空值
【发布时间】:2015-03-18 21:03:45
【问题描述】:

我正在尝试连接 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;

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

【问题讨论】:

  • @PaulCrovella 它应该返回 xml 响应。它甚至没有返回 echo $output;

标签: php xml sockets epp


【解决方案1】:

您没有提供足够的信息。 EPP 不能那样工作,您至少缺少两点:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多