I am using soap call request to below URL using PHP SoapClient
.
https://stagingxml.tamarindtours.in/Version1.0/BaseDetails.svc?wsdl
I have used follwing code.
$HeaderSecurity = array("UsernameToken"=>array("Username"=>"xxx",
"Password"=>"xxx",
)
);
$client = new SoapClient('https://stagingxml.tamarindtours.in/Version1.0/BaseDetails.svc?wsdl',array('trace' => 1));
$header[] = new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","Security",$HeaderSecurity);
$client->__setSoapHeaders($header);
//$client->__setLocation("https://YourTargetLocation/"); if you have wsdl file you don't need to use this line
$REsponse = $client->GetCountries();
I am getting following error.
Fatal error: Uncaught SoapFault exception: [a:InvalidSecurity] An error occurred when verifying security for the message. in /opt/lampp/htdocs/wssoap.php:148 Stack trace: #0 /opt/lampp/htdocs/wssoap.php(148): SoapClient->__call('GetCountries', Array) #1 /opt/lampp/htdocs/wssoap.php(148): SoapClient->GetCountries() #2 {main} thrown in /opt/lampp/htdocs/wssoap.php on line 148
Can you please help me out? Thanks.