Saturday, April 7, 2018

soap service trace in laravel - development

soap service trace in laravel

I want to get project list from service.I want to trace the value from the service but getting null value in laravel.How to analyse the request from the service and check for parameter from below service

Request

POST /test.asmx HTTP/1.1
Host: 172.24.115.XXX
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetAllProjects"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:types="http://tempuri.org/encodedTypes" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</soap:Envelope>

Response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:types="http://tempuri.org/encodedTypes" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <xsd:string xsi:type="xsd:string">string</xsd:string>
  </soap:Body>
</soap:Envelope>

Laravel code as given below with route

public function getAllProject() {
    SoapWrapper::add ( function ($service) {
                $service->name ( 'ProsWebServiceSoap' )->wsdl ( 'http://172.24.115.XXX:1012/test.asmx?WSDL' )->trace ( true );
            } );

            $data = array ();
             SoapWrapper::service ( 'ProsWebServiceSoap', function ($service) use($data) {

                $usersDetailsList = simplexml_load_string ( $service->call ( 'GetAllProjects', $data) );
                var_dump($service->call ( 'GetAllProjects', $data)); 
                print_r($usersDetailsList); 
                exit;
          }); 
     }

     route
     Route::get ( 'getAllProject', 'UserController@getAllProject' );



from Laravel Questions and Answers https://laravelquestions.com/laravel/soap-service-trace-in-laravel/
via Lzo Media

No comments:

Post a Comment