I have no experience using SOAP/WSDL services before, so the problem might be obvious, but the code (posted below) all result in:
Server was unable to process request. ---> Empty user name and password not allowed. Authentication failed
As far as i understand, it recognises that I invoked the Login method, but it didn't receive my login data.
This is from the API:
Login
Request:
UserName [String]
Password [String]
Response:
SessionId [String] (Description: Session id to use with further API calls)
I see in many SOAP examples that SoapHeader is used for authentication, but it requires a NAMESPACE, and I have no idea what that would be (API doesn't mention any namespace).
My code:
$username = "blabla";
$password = "bloblo";
$wsdl = "https://bla.bla/bla.asmx?wsdl";
$client = new SoapClient($wsdl, array("trace" => 1, "exception" => 0));
$loginParameters = array("UserName" => $username, "Password" => $password);
//$session = $client->Login->SessionId;
//$session = $client->__soapCall("Login", $loginParameters);
$session = $client->Login($loginParameters);
From WSDL:
<s:schema elementFormDefault="qualified" targetNamespace="http://xxxx/external/api/">
<s:element name="Login">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="LoginResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="LoginResult" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>