仅允许在文档开头使用soap XML声明

仅允许在文档开头使用soap XML声明,xml,soap,Xml,Soap,我正在使用soap创建简单的web服务。在尝试运行soap客户机时,我经常遇到这个错误“仅在文档开头允许XML声明”。这是我的密码 服务器: <?php class Member extends CI_Controller { function Member() { parent::__construct(); $ns = 'http://192.168.19.25/xampp/CodeIgniter/index.php/member';

我正在使用soap创建简单的web服务。在尝试运行soap客户机时,我经常遇到这个错误“仅在文档开头允许XML声明”。这是我的密码

服务器:

<?php
class Member extends CI_Controller
{ 
    function Member()
    {
        parent::__construct();
        $ns = 'http://192.168.19.25/xampp/CodeIgniter/index.php/member';
        // load nusoap toolkit library in controller
        $this->load->library("nusoap_library"); 
        // create soap server object
        $this->nusoap_server = new soap_server(); 
        // wsdl cinfiguration
        $this->nusoap_server->configureWSDL("SOAP Server Using NuSOAP in CodeIgniter", $ns); 
        // server namespace
        $this->nusoap_server->wsdl->schemaTargetNamespace = $ns; 
        // "addnumbers" method parameters
        $input_array = array ('a' => "xsd:string", 'b' => "xsd:string"); 
        $return_array = array ("return" => "xsd:string");
        $this->nusoap_server->register(
            'addnumbers', 
            $input_array, 
            $return_array, 
            "urn:SOAPServerWSDL", 
            "urn:".$ns."/addnumbers", 
            "rpc", 
            "encoded", 
            "Addition Of Two Numbers"
       );
    }

    function index()
    {
        function addnumbers($a,$b)
        {
            $c = $a + $b;
            return $c;
        }
        $this->nusoap_server->service(file_get_contents("php://input")); 
       // read raw data from request body
    }
}
?>