user3917559
user3917559

Reputation: 13

Caught exception:Internal Server Error Soap connection php

i'm building a function in php to check if a user and password match with an external database, so i can extract the emailadres. They have created a soap with wsdl for me so i can check this.

I can already check if the user exists, but every time i try to send a SoapCall to request the email, i get the error message Caught exception:Internal Server Error.

I looked around for this error, and there is somehow something wrong with the array i send as a parameter during the request. The array consist of the login / password of the user i'm checking.

The weird thing is, if i only send the array with only one parameter, then i don't recieve an error, but then i only recieve an empty string in return cause the username and password don't match.

I used the same structure to check if the user exists, and that is not giving the error.

Here is my code to make the connection:

checkEmail('HMichiels','xxxxxxx'); 
function checkEmail($pLoginStr,$pPassWordStr){
try{
$client = new SoapClient('https://milliarium.gabo-mi.com/Forms/Generic/Security/ExternalEmailService.asmx?WSDL', array('trace'=>1));
$params = array('pLoginStr'=>$pLoginStr,
            'pPassWordStr'=>$pPassWordStr,);
$response = $client->__soapCall("GetUserEmail",array($params));
$responseS = $response->GetUserEmailResult;

//check what i'm sending inside the soapcall
echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
} catch(SoapFault $fault){
echo 'Caught exception:', $fault->getMessage();
}

Anyone with more experience knows what the problem is ? I have lost hours on this error ><

Tnx

Upvotes: 1

Views: 1277

Answers (1)

Sumner Warren
Sumner Warren

Reputation: 26

Soap parameters are case sensitive and must match on the server side. You're sending pPassWordStr when you should be sending pPasswordStr, as defined in the WSDL.

Upvotes: 1

Related Questions