Sending a Soap Header with a WSDL Soap Request with PHP
Posted
by Josh Smeaton
on Stack Overflow
See other posts from Stack Overflow
or by Josh Smeaton
Published on 2009-02-26T05:31:31Z
Indexed on
2010/03/26
13:53 UTC
Read the original article
Hit count: 943
I'm extremely new to SOAP and I'm trying to implement a quick test client in PHP that consumes a ASP.NET web service. The web service relies on a Soap Header that contains authorization parameters.
Is it possible to send the auth header along with a soap request when using WSDL?
My code:
php
$service = new SoapClient("http://localhost:16840/CTI.ConfigStack.WS/ATeamService.asmx?WSDL");
$service->AddPendingUsers($users, 3); // Example
webservice
[SoapHeader("AuthorisationHeader")]
[WebMethod]
public void AddPendingUsers(List<PendingUser> users, int templateUserId)
{
ateamService.AddPendingUsers(users, templateUserId, AuthorisationHeader.UserId);
}
How would the auth header be passed in this context? Or will I need to do a low lever __soapCall() to pass in the header? Also, am I invoking the correct soap call within PHP?
© Stack Overflow or respective owner