1

How to create soap API containing data from database in laravel?

I have done rest API but the client need SOAP API to implement it in a queue management system. I don't know much about soap and XML.

James Z
  • 11,838
  • 10
  • 25
  • 41
Vishnuprasad
  • 11
  • 1
  • 2

1 Answers1

0

You can use this package: https://github.com/econea/nusoap, instantiate a server and register your endpoints

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

Check for other aswers with this implementation: nusoap simple server

Walter Cejas
  • 1,153
  • 10
  • 18