title: I'm using moodle with WSDL and Nusoap but I cannot connect because I have errors in my code
body: <h3>obtenerDatosCentro.php code</h3>
  
  <pre><code>&lt;?php
  
  require_once 'config.php';
  
  // incluimos los datos necesarios para establecer conexion con la BD
  include("conexion.php");
  
  require_once('lib/nusoap.php');
  
  $miURL = 'http://localhost/seguimiento';
  
  $endpoint = 'http://localhost/seguimiento/obtenerDatosCentro.php';
  
  $server = new soap_server(URL_WSDL, array('encoding' =&gt; 'ISO-8859-1'));
  
  
  //$server-&gt;configureWSDL('Web Service', $miURL,$endpoint);
  
  //$server-&gt;wsdl-&gt;schemaTargetNamespace=$miURL;
  
  ini_set("soap.wsdl_cache_enabled", "0");
  
  $consulta = query();
  
  //$server-&gt;service($HTTP_RAW_POST_DATA);
  //$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
  
  $server-&gt;register(
                       'mostrar',       // method name
                       array('$cadena' =&gt; 'xsd:string'),                     // output parameters
                       'urn:getfile1',      // namespace
                       'urn:getfile1/getFile',    // SOAPAction
                       'rpc',        // style
                       'encoded'       
      );
  
  //$server-&gt;service($HTTP_RAW_POST_DATA);
  
  $server-&gt;service(file_get_contents("php://input"));
  
  class ObtenerDatos {
  
      function mostrar(){
  
          $cadena = "Hola";
  
          return $cadena;
      }
  
      /*function obtenerDatosCentro() {
  
  
          $list = array();
  
          while($row = mysql_fetch_assoc($consulta)) {
  
  
              $list= array('ID_CENTRO' =&gt; array('ORIGEN_CENTRO' =&gt; $row['ORIGEN_CENTRO'], 'CODIGO_CENTRO' =&gt; $row['CODIGO_CENTRO']), 'NOMBRE_CENTRO'=&gt;$row['NOMBRE_CENTRO'], 'URL_PLATAFORMA'=&gt;$row['URL_PLATAFORMA'],
            'URL_SEGUIMIENTO'=&gt;$row['URL_SEGUIMIENTO'],'TELEFONO'=&gt;$row['TELEFONO'],'EMAIL'=&gt;$row['EMAIL']); ?&gt;
  
  
              &lt;center&gt;&lt;h1&gt;Mostrar Datos Centro&lt;/h1&gt;
  
            &lt;table border="1" align="center"&gt;
              &lt;tr&gt;
                  &lt;td class="primera_fila"&gt;ID_CENTRO&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;ORIGEN_CENTRO&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;CODIGO_CENTRO&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;NOMBRE_CENTRO&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;URL_PLATAFORMA&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;URL_SEGUIMIENTO&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;TELEFONO&lt;/td&gt;
                  &lt;td class="primera_fila"&gt;EMAIL&lt;/td&gt;
  
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td class="sin"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;/tr&gt; 
  
              &lt;?php while($filas-&gt;$list-&gt;mysqli_fetch_assoc())?&gt;
  
                  &lt;tr&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;ID_CENTRO ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;ORIGEN_CENTRO ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;CODIGO_CENTRO ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;NOMBRE_CENTRO ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;URL_PLATAFORMA ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;URL_SEGUIMIENTO ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;TELEFONO ?&gt;&lt;/td&gt;
                       &lt;td&gt;&lt;?php echo $filas&gt;EMAIL ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;   
  
              &lt;/center&gt;           
  
      &lt;?php } 
  
      }*/
  
  
  }
  ?&gt;
  </code></pre>
  
  <p>I tried using soap and nusoap. I commented out some lines because I was trying them, but nothing was working at all.</p>
  
  <p>Now I only have the following error.</p>
  
  <blockquote>
    <p>You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.</p>
  </blockquote>
  
  <p>I think I have to register all the methods I have in obtenerDatosCentro.php, but I don't know what to do.</p>