soap只用过 NuSOAP http://sourceforge.net/projects/nusoap/
先用用现成的也许有助于理解。呵呵

解决方案 »

  1.   

    WSDL文档有工具可以生成的,.net里就有,WSDL就是web service的接口描述,也就是说有了wsdl才能知道怎么跟web service打交道,
    如果没有wsdl,但是你知道web service的接口的话,也同样可以进行通信。通信无非就是xml文本,只要格式符合web service的要求即可。
    uri一般作为命名空间使用。
      

  2.   

    我一般会用VS来创建WS的服务器。
      

  3.   

    用ZDE 的工具吧,自动将函数或者类生成wsdl。
      

  4.   

    NuSoap http://sourceforge.net/projects/nusoap/<?php
    // Pull in the NuSOAP code
    require_once('lib/nusoap.php');// Define the method as a PHP function
    function hello($name) {
    return 'Hello, '.$name;
    }//echo '<pre>';print_r($_SERVER);echo '</pre>';
    $_SERVER['HTTPS'] = isset($_SERVER['HTTPS']) ? "on" : "off";
    // Create the server instance
    $server = new soap_server();
    // Initialize WSDL support
    $server->configureWSDL('hellowsdl', 'urn:hellowsdl');
    // Put the WSDL schema types in the namespace with the tns prefix
    $server->wsdl->schemaTargetNamespace = 'urn:hellowsdl';
    $soap_defencoding = 'ISO-8859-1';
    $server->soap_defencoding='ISO-8859-1';
    // Register the method to expose
    $server->register('hello', // method name
    array('name' => 'xsd:string'), // input parameters
    array('return' => 'xsd:string'), // output parameters
    'urn:hellowsdl', // namespace
    'urn:hellowsdl#hello', // soapaction
    'rpc', // style
    'encoded', // use
    'Says hello to the caller' // documentation
    );// 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);
    ?>