Estimados; tengo un problema con un WS.
No puedo recibir un DataSet.
Si puedo recibir cuando es un String.
A ver si me ayudan, acá está el código de mi web service (servicio.asmx):
Código:
<%@ WebService Language="C#" Class="Universidades.UniversidadesService" %>
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services;
namespace Universidades
{
[WebService(Namespace = "http://h4/webservices/")]
public class UniversidadesService: WebService
{
[WebMethod]
public DataSet getUniversidades(string campo, string textobuscar)
{
SqlConnection conexion = new SqlConnection("Data Source=localhost;Initial Catalog=BD;Integrated Security=false;User ID=us;Password=pass;");
SqlDataAdapter adapter = new SqlDataAdapter( "select * from tabla", conexion);
DataSet ds = new DataSet();
try
{
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
adapter.Fill(ds);
return ds;
}
catch(SqlException ex)
{
return("se ha producido una excepción: "+ex);
}
}
}
}
y acá lo recibo en PHP:
Código:
try {
$client = new SoapClient("http://web/servicio.asmx?WSDL",
array('cache_wsdl' => WSDL_CACHE_NONE,'trace' => TRUE));
$param = array(
'campo' => 'razonsoc',
'textobuscar' => 'as'
);
echo var_dump($client->getUniversidades($param))."<br><br>";
exit();
El asunto es que sí recibo un tipo STRING, pero el DataSet no me lo recibe y me da el mensaje:
Warning: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://web/servicio.asmx?WSDL' : failed to load external entity "http://web/servicio.asmx?WSDL" in C:\xampp\htdocs\pruebas2\llama_net.php on line 54
el .NET tiene un framework 1.1 NO PUEDO ACTUALIZARLO.
A ver si me dan una ayuda.
Saludos.