> -----Original Message----- > From: PHPDiscuss - PHP Newsgroups and mailing lists > > hi, i am using the following code to connect to web-service, > but i fail to > connect cause of i cannt set header. > how can i set header? > ( the lines i wrote with $k->header simply dont work, the xml that is > sending to the server without header at all) > <?php > require_once("webservice.php"); > $k = WebService::ServiceProxy("address.asmx?WSDL"); > $par=array('id'=>111,'desc'=>'blabla'); > $headers = '<LoginHeader xmlns="aaa">' . > '<username xmlns="aaa" >222</username> <password > xmlns="bb">111</password></LoginHeader>'; > $k->header=$headers; > $res = $k->call("procedure",array($par),"kk","hhh"); > ?> I add a header containing a GUID to identifiy a logged in user. Experiment with some code similar to this:- $ourHeader = new SOAP_Header('TokenHeader', 'Struct', array('InnerToken' => $this->userToken), false); $ourHeader->attributes['<name>'] = <value>; $this->addHeader($ourHeader); Regards, Mike C ________________________________________________________________________ This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com ________________________________________________________________________ -- PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php