0

i making very simple test request. There is my document:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://localhost/webshop">
   <soap:Header/>
   <soap:Body>
      <web:TestRequest/>
   </soap:Body>
</soap:Envelope>

Here is my request:

$uri = '...';
$login = '...';
$pass = '...';
try{
 $client = new SoapClient($uri, Array('login' => $login, 'password' => $pass));
}catch(SoapFault $exception){
 $errors[] = 'Error: '.$exception;
}
//print_r($errors); //empty


if($client){
  $param = array();
  //var_dump($client);
  //var_dump($client->__getFunctions());
  $result = $client->__doRequest('TestRequest', $param);
  //$result = $client->TestRequest();
  var_dump($result); //return NULL
    echo "<br>";
  var_dump("REQUEST=", $client->__getLastRequest()); //return string(7) "REQUEST" NULL 
  var_dump("RESPONSE=", $client->__getLastResponse());//return string(8) "RESPONSE" NULL
}

Is it ok that it's return NULL? Or i made something wrong!?

Thanks!

1 Answer 1

0

You are missing the action parameter on your __doRequest() . Refer here

Should be..

$result = $client->__doRequest('web:TestRequest', $param, $action, $version);
                                                          ----^--- ----^----
2
  • Sorry? but i'm really don't understand. What i need to add to action parameter.
    – glazsasha
    Commented Dec 13, 2013 at 11:19
  • Just pass it like $result = $client->__doRequest('web:TestRequest',"","","",0); Commented Dec 13, 2013 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.