문제

안녕하세요 여러분, 문제가 있습니다 (다시). 이번에는 PHP5와 MySQL을 포함하는 XAMPP 1.7.1 w/ XAMPP 1.7.1을 사용하려고 노력하고 있습니다.

<?php
// Pull in the NuSOAP code
require_once('nusoap.php');
// Create the client instance
$client = new soapclient('http://localhost/mysql/helloworld2.php');
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<p><b>Constructor error: ' . $err . '</b></p>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$result = $client->call('hello', array('name' => 'Doro'));
// Check for a fault
if ($client->fault) {
    echo '<p><b>Fault: ';
    print_r($result);
    echo '</b></p>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<p><b>Error: ' . $err . '</b></p>';
    } else {
        // Display the result
        print_r($result);
    }
}

?>

그리고 내 비누 서버 :

   // Enable debugging *before* creating server instance
   $debug = 1;
   // Create the server instance
   $server = new soap_server;
   // Register the method to expose
   $server->register('hello');

   // Define the method as a PHP function
   function hello($name) {

$dbhost = 'blah';
$dbuser = 'blub';
$dbpass = 'booboo';
try{
       $conn = MYSQL_CONNECT($dbhost, $dbuser, $dbpass) 
           or die ('Error connecting to mysql');

    if( !$conn ){
        return 'Hello, '.$name.' ...  too bad, I cannot connect to the db!';
    }
    else{
        $dbname = 'soaperina';
        MYSQL_SELECT_DB($dbname) or die('Error connecting to '.dbname);

        $queryres = @mysql_db_query(
                          'response',
                          'SELECT * FROM farben');

                    return 'RESPONSE: <br>';

                   while( $arr = mysql_fetch_array( $queryres ) ){
                         return $arr["ID"]." - ".$arr["Farben"]." - ".$arr["Rating"]."<br>";
                   }
            }
    }
    catch(Exception $e){
                 return 'Sorry, '.$name.', but that did not work at all!';
        }


   }
   // Use the request to (try to) invoke the service
   $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
   $server->service($HTTP_RAW_POST_DATA);
?>

나는 PHP가 작동하고 Apache가 작동하고 MySQL이 작동한다는 것을 알고 있습니다. 또한 함께 작동하지만 Nusoap과 함께 작동하려고 할 때는 작동하지 않습니다. 나는 다음과 같이 받는다 :

경고 : soapclient :: soapclient (http : //localhost/mysql/helloworld2.php) [SOAPCLIENT.SOAPCLIENT] : 스트림을 열지 못했습니다 : EIN Verbindungsversuch ist fehlgeschlagen, da die gegenstelle nach einer bestimmt Zeitspanne Nicht Richtig Reagiert Hat, Oder는 HERSTELLTE VERBINDUNG WAR FEHLERHAFT, DA DER BURBUNDEN HIST REAGIERT HAT. C : xampp htdocs mysql helloworld2client.php on 6 on 6

경고 : SOAPCLIENT :: SOAPCLIENT () [SOAPCLIENT.SOAPCLIENT] : I/O 경고 : 외부 엔티티를로드하지 못했습니다. "http : //localhost/mysql/helloworld2.php"C : xampp htdocs mysql helloworld2client.php on 6

치명적인 오류 : 60 초의 최대 실행 시간 C : xampp htdocs mysql helloworld2client.php에서 41 행

나는 그것이 무엇을 의미하는지 전혀 모른다. 도와 줄 수 있기를 바랍니다 !!! 미리 thnx :)

도움이 되었습니까?

해결책 2

내 자신의 질문에 대한 답변을 제공하기 위해 : Nusoap은 PHP5에 문제가 있습니다 ... 그물에는 몇 가지 답변과 솔루션이 많지 않지만 나와 함께 작동하지 않았습니다. 나는 PHP4로 다운 그레이드되어 잘 작동합니다 ...

다른 팁

PHP5와 함께 NUSOAP 버전 1.7.3을 사용했습니다. 이 NUSOAP 1.7.3에서는 NU_SOAPCLIENT로 이름이 바뀌 었습니다.

당신은 이것을 시도 할 수 있습니다 :

$client = new nusoap_client('http://localhost/mysql/helloworld2.php');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top