Page 1 of 1
soap headers and webservice
Posted: Sat Sep 24, 2005 5:45 pm
by neversleep
After days of googling and not getting any answers I turn to this forum hoping for some help. I need to comsume a webservice wich requires special headers in the soap msg with logininformation. My question is, how do I add headers to the msg? I would like to do this with the extension in php5...but if anyone here have better knowledge in nusoap or anything else this would work aswell. Getting desperate here!
Hope someone could lead me on to the right track
regards
Posted: Sat Sep 24, 2005 6:03 pm
by John Cartwright
SoapClient->__soapCall()
SoapHeader is a special low-level class for passing or returning SOAP headers. It's just a data holder and it does not have any special methods except its constructor. It can be used in the SoapClient->__soapCall() method to pass a SOAP header or in a SOAP header handler to return the header in a SOAP response.
Posted: Sun Sep 25, 2005 1:59 am
by neversleep
Thank you Jcart for the reply
I've trying to work with that function shortly but didn't get it to work. The structure in my call is rather complexed and I cant get it to work without wdsl wich cant be used in SoapClient->__soapCall()
I've been experimenting with setSoapHeaders...doing like this:
$userId = new SoapHeader('', 'userId', 'xxx'); //not sure if the first parameter here is important?
$userPassword = new SoapHeader('', 'userPassword', 'xxx');
$client->__setSoapHeaders(array(1 => $userId, 2 => $userPassword));
but I get the response: missing header userid...
Posted: Sun Sep 25, 2005 2:22 am
by neversleep
nevermind...got it to work. The namespaceheader in SoapHeader was important