Attaching SOAP Header
Posted: Wed Feb 24, 2010 9:27 am
Having some small trouble accessing a protected web service, hopefully someone can help me out - I'm sure I'm just missing something simple here.
Basically, I need to construct the following SOAP message in PHP. I have no trouble with the bottom part, the actual request, its attached the auth header that's tripping me up. Anybody know how to do this?
Basically, I need to construct the following SOAP message in PHP. I have no trouble with the bottom part, the actual request, its attached the auth header that's tripping me up. Anybody know how to do this?
Code: Select all
<soapenv:Envelope>
<soapenv:Header>
<q0:AuthHeader>
<q0:username>JED</q0:username>
<q0:password>JEDI2003</q0:password>
</q0:AuthHeader>
</soapenv:Header>
<soapenv:Body>
<q0:SendString>
<q0:thestring>Hello there</q0:thestring>
</q0:SendString>
</soapenv:Body>
</soapenv:Envelope>Code: Select all
$client = new soapclient($wsdl);
//attach header somehow here
$client->SendString("hello there");