Laravel肥皂Api

时间:2018-12-07 11:58:07

标签: laravel api soap

如何在Laravel中创建包含来自数据库数据的soap API?

我已经完成了rest API,但是客户端需要SOAP API才能在队列管理系统中实现它。我对soap和XML不太了解。

1 个答案:

答案 0 :(得分:0)

您可以使用以下软件包:https://github.com/econea/nusoap,实例化服务器并注册端点

$server = new \nusoap_server();
$server->configureWSDL('TestService', "urn:delos", url('ws-delos') , 'rpc');

$this->server->register('Receive_products',
            [
                'id' => 'xsd:int',
                'name' => 'xsd:string',
                'category' => 'xsd:string',
            ],
            [
                'output' => 'xsd:string'
            ],
            "urn:delos",
            "urn:delos#Receive_products", <--- this function must be registered global in Laravel 
            "rpc",
            'encoded',
            "Receive products data");

通过此实现检查其他请求者: nusoap simple server