你是怎么做的?
是不是编辑class.nusoap_base.php,然后修改var $soap_defencoding = 'UTF-8';

解决方案 »

  1.   

    设置成:UTF-8啊
    $soap_defencoding = 'UTF-8';
      

  2.   

    这样设置response回来的信息应该是UTF-8的,e.g.
    ......
    Server: NuSOAP Server v0.6.3
    Connection: Close
    Content-Type: text/xml; charset=UTF-8
    ......
      

  3.   

    呵呵,那代码应该怎么写呢?
    <?php
    // Pull in the NuSOAP code
    require_once('lib/nusoap.php');
    // 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 = 'UTF-8';
    $server->soap_defencoding='utf-8';
    // 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
                                  // style
                   // use
        'Says hello to the caller'            // documentation
    );
    // Define the method as a PHP function
    function hello($name) {
            return 'Hello, ' . $name;
    }
    // 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);
    ?>这是源码。
     <?xml version="1.0" encoding="ISO-8859-1" ?> 
    这是WSDL中的XML编码。如何变成
     <?xml version="1.0" encoding="utf-1" ?> 
      

  4.   

    看一下nusoap.php中的serialize()方法
      

  5.   

    ???
    我找了nusoap.php中的serialize()方法
    没有发现修改的地方啊?PHP我只学了两天,现在要开发项目,没办法啊
      

  6.   

    serialize()方法中有生成xml声明的部分,我想不用我多说了吧。
      

  7.   

    我把Class.wsdl.php改成这样了,还是不行,如果你知道,你就把改的位置和PHP的文件直接告诉我吧。function serialize()
    {
    $xml = '<?xml version="1.0" encoding="UTF-8"?><definitions';
      

  8.   

    兄弟,是nusoap.php中的serialize()方法,位置大概在37xx行。
      

  9.   

    我晕,CSDN怎么不能给分结贴了