notfalsedev / laravel-soap

A soap client wrapper for Laravel
MIT License
634 stars 122 forks source link

SoapFault: no UserCredentials in SOAP Header #130

Closed unpherum closed 7 years ago

unpherum commented 7 years ago

I got this error message SoapFault: no UserCredentials in SOAP Header in file /var/www/html/MyProjectFolder/vendor/artisaninweb/laravel-soap/src/Artisaninweb/SoapWrapper/Client.php on line 189

and my header is:

$auth_params = new stdClass();
$auth = new stdClass();
$auth->userid = $this->userid;
$auth->password = $this->password;
$auth_params->UserCredentials = $auth;

$header_params = new SoapVar($auth_params, SOAP_ENC_OBJECT);
->header($this->ns, $this->appName, $header_params, false, null)

Pretty sure I have done something wrong, but I am not sure what is the correct one. please kindly help to see what should it be. how can i construct the header for Auth. and end point showing this document I should have sent this to them. so i don't know if I have reach them yet and got this error from them or the request is not yet out to any where.

<soap:Header>
         <UserCredentials>
                  <userid>user</userid>
                  <password>password</password>
         </UserCredentials>
</soap:Header>
unpherum commented 7 years ago

Hmmm just realized later that I put the wrong namespace, cause the document didn't mention the sn for me, and I thought the namespace should be same to the URL but without ?wsdl I did with build in soapClient for PHP and it works but will do again with this wrapper later. should be fine.

LittleBitGirl commented 4 years ago

I have the same issue, did you solve it with wrapper?