notfalsedev / laravel-soap

A soap client wrapper for Laravel
MIT License
633 stars 121 forks source link

Enable WS-A Addresing #151

Open thrazu opened 6 years ago

thrazu commented 6 years ago

Hi. I'm new to Soap and I don't have much time to dig in deeper. I'm currently using SoapUI to make a request and it works great only with the WS-A Addressing enabled. I wish to know how can I use this option with laravel-soap? Any solution - much appreciated.

P.S.: Without the WS-A Addressing enabled I'm getting this error: The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/...'.

thrazu commented 6 years ago

OK. I have fixed this issue creating a header:

        $this->soapWrapper->add('Gps', function ($service) {
            $service
                ->wsdl('https://...?wsdl')
                ->trace(true)
                ->header('http://www.w3.org/2005/08/addressing', 'Action', 'http://tempuri.org/ITrackGPS/GetCarriersLocation')
                ->options($this->options);
        });

It seems that the soap header with the namespace http://www.w3.org/2005/08/addressing & name Action is the equivalent of WS-Addressing in SoapUI.