【问题标题】:How to implement OCPP protocol with SOAP in php?如何在 php 中使用 SOAP 实现 OCPP 协议?
【发布时间】:2019-05-29 13:27:59
【问题描述】:

我需要在 php 中将 OCPP 连接与 SOAP 集成。我发现了很多关于 OCPP 和 JSON 的例子,但没有发现 OCPP 和 SOAP 的例子。如果可能的话,任何人都可以分享几个例子吗?谢谢!

【问题讨论】:

标签: php soap pahocpp


【解决方案1】:

推荐使用 Json 而不是 SOAP。 Json 最轻巧,速度更快。

但是如果你想在 PHP 中使用 SOAP:

$client = new SoapClient($wsdl_path, array(
        'soap_version' => SOAP_1_2,
        'connection_timeout' => 8,
        'cache_wsdl' => WSDL_CACHE_NONE,
        'trace' => 1
    )
);

然后

$call = $client->remoteStartTransaction(array(
        'connectorId' => $connectorId,
        'idTag' => $idTag
    )
);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-02
    • 2013-07-01
    • 1970-01-01
    • 2011-06-19
    相关资源
    最近更新 更多