2012-08-11 2 views
1

에서 호출하고 var_dump ($ result)를 호출 한 다음 bool (false)으로 표시하는 이유는 무엇입니까? 내가 예를 내 매개 변수를 변경하고 1234 여기에 쓰기 위해 :메소드 호출 bool (false)를 nusoap

require_once('../class/nusoap.class.php'); 
// Create the client instance 
$client = new soapclient('sample?wsdl' ,'wsdl', '', '', '', ''); 
$soapClient->soap_defencoding = 'UTF-8'; 
$soapClient->debug_flag = false; 

// Check for an error 
$err = $client->getError(); 
if ($err) { 
    // Display the error 
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; 
    // At this point, you know the call that follows will fail 
} 
// Call the SOAP method 
$result = $client->call('enqueue', array('from' => '+12345', 
'rcpt_array' => '123456', 
'msg' => 'hi', 
'uname' => 'example1', 
'pass' => 'example2')); 
var_dump($result); 

답변

1

PHP 당으로 SoapClient 문서를 SoapClient 생성자의 두 번째 매개 변수는 array

public SoapClient::SoapClient (mixed $wsdl [, array $options ]) 

해야하지만 당신의 경우에 당신이있어 일련의 인수를 전달합니다. 나는 이것이 잘 될지 모르겠다.

둘째 비누 호출 wsdl으로 작업하는 동안 매개 변수를 사용하여 예제에 따라 wsdl 메서드를 직접 호출 할 수 있습니다. //이 NuSOAP 코드에 require_once를 ('../ 클래스/nusoap을 당겨 : 여기

$client->enqueue(array('from' => '+12345', 
'rcpt_array' => '123456', 
'msg' => 'hi', 
'uname' => 'example1', 
'pass' => 'example2')); 

내가 이런 코드를 변경하지만 여전히 문제가 간단한 PHP 비누 호출 example

+0

입니다. class.php '); // 클라이언트 인스턴스를 만듭니다. $ client = new soapclient ('sample? wsdl'); $ client-> soap_defencoding = 'UTF-8'; $ client-> debug_flag = false; $ result = $ client-> enqueue (array ('from'= ''+ sample ', 'rcpt_array '=>'+ sample ', 'msg '='샘플 ', 'uname '=> 'sample', 'pass'=> 'sample')); var_dump ($ result); 정의되지 않은 메소드 호출 soapclient :: enqueue() – user1574533

+0

예제를보고 코드에서'nusoap'을 제거하고 시도하십시오. – Vins

+0

당신은 nusaop을 제거하는 것에 대해 무엇을 의미합니까 ?????? 나는 모든 작업을 할 수 있습니다. 정의되지 않은 메소드 호출 soapclient :: enqueue() – user1574533