Foros del Web » Programando para Internet » ASPX (.net) »

Problema con DatSet Web service .NET C# consumido por php

Estas en el tema de Problema con DatSet Web service .NET C# consumido por php en el foro de ASPX (.net) en Foros del Web. 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á ...
  #1 (permalink)  
Antiguo 13/11/2013, 09:53
Avatar de franfritz  
Fecha de Ingreso: marzo-2003
Ubicación: Stgo Chile
Mensajes: 260
Antigüedad: 21 años
Puntos: 0
Problema con DatSet Web service .NET C# consumido por php

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.

Última edición por franfritz; 13/11/2013 a las 12:15

Etiquetas: net, php, service, tabla, text
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:45.