顶!~
正在看php的源代码,仍然未找到办法。。
请熟悉的大侠给指条明路

解决方案 »

  1.   

    http://support.nusphere.com/index.php  nusoap开发网站上的论坛
    呵呵,我去试试先Soap is a protocol that requires two parts to be involved. First one is close-end server that runs requests on the far-end server and shows results to the client. 
    NuSoap library can run on either or on both of them. If you want to run NuSoap server on the far-end server (SOAP server) you'd create a php file and use it in your WSDL URL. 
    For example, suppose you have a php function on far-end server and you want it to be run via SOAP protocol:Code: <?php 
      require_once('nusoap.php'); 
      $server = new soap_server; 
      $server->configureWSDL('Test','http://soapinterop.org/'); 
      $server->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/'; 
      
      $server->register( 
            'hello', 
            array('name'=>'xsd:string'), 
            array('return'=>'xsd:string'), 
            'http://soapinterop.org/');   function hello($name){ 
         return "Hello $name!"; 
      }   $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? 
         $HTTP_RAW_POST_DATA : ''; 
      $server->service($HTTP_RAW_POST_DATA); 
    ?> 
     You see that this you have to define input and output parameters for your function and register it with instance of soap_server class. This way you can register as many functions as you wish. 
    All of them can be invoked by any SOAP-compatible clients, not only NuSoap. 
    Target WSDL document is generated using data registered in $server->register() method call. Suppose you placed test.php file shown above in the root of you web. It means that the target WSDL URL should be 
    http://yourserver/test.php?wsdl 
    If you run this link without wsdl argument you'll see a short description in HTML form. Now few hints about close-end server (SOAP client). It can run a given method on a given SOAP server using WSDL URL. 
    For example with the far-end server sample shown above it can be done using the following way:Code: <?php 
      require_once('nusoap.php'); 
      $arg = "test message"; 
      $wsdl = "http://yourserver/test.php?wsdl"; 
      $soap = new soapclient($wsdl,"wsdl"); 
      $proxy = $soap->getProxy(); 
      $result = $proxy->hello($arg); 
    ?> 
     
    Now about NuSoap wizard. It can generate a code sample shown above to be run on SOAP client side (close-end server). First it ask if you know a particular WSDL URL or want to select one from the public domain (service). Once WSDL URL is given you are able to select an operation (hello function in our case). Once operation is selected you can see all necessary arguments for it and you can type values that the call should be generated with.