I really need help on this, and quickly. I am trying to call .net webservices using soap. I have no problem calling services without a header. But If i need to call a service with a header, it does not work. Using visual studio, the person that receives the request get an empty header , so obviously , my request die. I am setting the header as specified in different sites. but they just don't work. What I hate even more if that I get the. "It works in .net and java", ie. php is junk not use it. I hate that!!
For what I can see(so many post), php has not done a very good job when it relates to the headers.
Option 1
Code: Select all
$SessionKey = new SOAPHeader($ns, 'SessionKey', $LoginResponse->LoginResult->SessionKey);
$SessionRole = new SOAPHeader($ns, 'SessionRole',$LoginResponse->LoginResult->SessionRole);
$UserType = new SOAPHeader($ns, 'UserType', $LoginResponse->LoginResult->UserType);
$UserName = new SOAPHeader($ns, 'UserName',$LoginResponse->LoginResult->UserName);
$headers = array($SessionKey, $SessionRole, $UserType, $UserName);
$this->soapClient->__setSoapHeaders($headers);
Code: Select all
$authvalues = new SoapVar($AuthHeader,SOAP_ENC_OBJECT);
$ns = 'name space here';
$header = new SoapHeader($ns,
"AuthHeader", // Rename this to the tag you need
$authvalues,
false);