0

I want to use nusoap library in applications using laravel 4. I have an update on the composer with NoiselabsNuSOAP :

NuSOAP Library with composer

And I have followed the user manual

My code :

public function CallSOAP()
    {
        $client = new \nusoap_client('http://mywebsite/services/VcareServices.php', true);
        $response = $client->call('validateLogin', array('EMAIL'=>'bertho_joris@yahoo.co.id', 'PASSWORD'=>'3b774f5aae6b97a060864f8310hg6785'));
        return $response;
    }

But I get an error message :

UnexpectedValueException The Response content must be a string or object implementing __toString(), "boolean" given.

My question:

  1. Is this library I can use for my laravel application?
  2. How do I use to use it?
4

2 回答 2

0

确实,也许您的 SOAP 响应不是正确的,但首先尝试添加:

$client->soap_defencoding = 'UTF-8'; 
$client->decode_utf8 = false;

并检查您的服务返回什么,也许您必须指定响应对象的元素,例如:

return $response['MyValue'];

或者

return $response['key']['value'];
于 2014-07-10T02:31:23.483 回答
0

在我看来,nusoap 库正在正确加载,否则您会收到有关 \nusoap_client 不是可识别函数的错误。

您正在使用的端点 ( http://mywebsite/services/VcareServices.php) 更有可能没有提供有效的 SOAP 响应。

检查您的端点是否符合 SOAP 协议,或针对您知道有效的现有 SOAP 服务器测试您的客户端。这应该可以帮助您诊断问题。

于 2013-07-22T13:29:59.290 回答