dsizmmwnm56437180 2017-07-25 12:09
浏览 67
已采纳

在PHP中通过TCP发送XML EPP请求

I'm using this code to connect to a registrar via TCP.

stream_socket_client('tcp://registrarwebsite:700', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $fc)

Connection was successful, as for $fc, I am using stream_context_create to pass SSL certificate and key. At this point, everything works fine.

  $fc = stream_context_create(array(
            'ssl' => array('allow_self_signed' => true,
                'local_cert' => 'ma_registrar_cert.pem',
                'local_pk' => 'ma_registrar_key.pem'
        )));

I want to add an XML request to stream_context_create, to send XML EPP requests to the distant server.

How to do that?

Edit

This is an example of the XML request I want to send to the server along with the stream context.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>     
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> 
  <command> 
    <create> 
      <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"> 
        <domain:name>testdomain.com</domain:name> 
        <domain:period unit="y">testdomain.com</domain:period> 
        <domain:registrant>John Doe</domain:registrant> 
      </domain:create> 
    </create> 
    <clTRID>reference</clTRID> 
  </command> 
</epp>
  • 写回答

1条回答 默认 最新

  • doushi3189 2017-12-26 18:26
    关注

    See my other answer here: https://stackoverflow.com/a/47982304/6368697 to your related question. You basically do not implement the EPP protocol correctly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么