运行附加代码时,出现以下转储&错误。我感到困惑的是,$ procID似乎是以字符串的形式返回的,但只要我尝试再次传递它,它的一个对象?我如何得到它/保持一个字符串?谢谢。PHP:可捕捉的致命错误:类stdClass的对象无法转换为字符串
object(stdClass)#2 (1) { ["processId"]=> string(13) "Genesis114001" } string(311) "Genesis114001" string(293) " Genesis " Catchable fatal error: Object of class stdClass could not be converted to string in C:\wamp\www\SugarCE\testSOAPShawn.php on line 15
<?php
set_time_limit(0);
require_once('nusoap.php');
require_once('BenefitSOAP.php'); //WSDL to PHP Classes
$client = new SoapClient('C:\wsdl\BenefitDeterminationProcess_BenefitDialogueServiceSOAP.wsdl', array('trace' => 1));
$procID = $client->start(array("prefix"=>"Genesis"));
$respXML = $client->__getLastResponse();
$requXML = $client->__getLastRequest();
echo "<p/>";
var_dump($procID);
//echo "<p/>";
var_dump($respXML);
//echo "<p/>";
var_dump($requXML);
$exchange = $client->exchangeOptions(array("processId"=>$procID)); //LINE 15
$end = $client->stop(array("processId"=>$procID));
?>
您确实需要更好地设置您的代码格式,因此人们不必努力去理解它在做什么。 – KOGI 2011-02-17 18:00:38