Foros del Web » Programando para Internet » PHP » Frameworks y PHP orientado a objetos »

web service PHP->c#

Estas en el tema de web service PHP->c# en el foro de Frameworks y PHP orientado a objetos en Foros del Web. Muy buenas, tengo un web service creado en c#, que recive dos arrays de enteros y devuelve un entero, y estoy creando un cliente en ...
  #1 (permalink)  
Antiguo 18/12/2006, 09:45
 
Fecha de Ingreso: diciembre-2006
Mensajes: 6
Antigüedad: 17 años, 4 meses
Puntos: 0
web service PHP->c#

Muy buenas, tengo un web service creado en c#, que recive dos arrays de enteros y devuelve un entero, y estoy creando un cliente en PHP para este web service. En el cliente php yo recojo los enteros mediante un formulario y los meto en un array y los mando al web service en c#, pero no llegan bien. Al web service solo llega la cadena "array". Podrian ayudarme si alguien sabe como solucionarlo, o como recojer los enteros en PHP. Un saludo y gracias
  #2 (permalink)  
Antiguo 18/12/2006, 10:31
 
Fecha de Ingreso: diciembre-2001
Ubicación: Asuncion
Mensajes: 143
Antigüedad: 22 años, 4 meses
Puntos: 1
Re: web service PHP->c#

Seria bueno que pongas tu codigo
  #3 (permalink)  
Antiguo 18/12/2006, 10:54
 
Fecha de Ingreso: diciembre-2006
Mensajes: 6
Antigüedad: 17 años, 4 meses
Puntos: 0
Re: web service PHP->c#

CLIENTE PHP:
<html>
<head>
</head>
<body>


<?php


var_dump($_POST['llegada1']);
var_dump($_POST['llegada2']);
var_dump($_POST['llegada3']);



//if(empty($_POST['llegada1'])) {
if(!isset($_POST['llegada1']) && !count($_POST['llegada1'])) {

?>
<h3> Planificador de Procesos </h3>

<form action="procesclient.php" method="POST">
<table>
<tr>
<td>
Introduce el instante de inicio del proceso1:
<input name="llegada1">
</td>
<td>
Introduce la duracion del proceso:
<input name="duracion1">
</td>
</tr>
<tr>
<td>
Introduce el instante de inicio del proceso1:
<input name="llegada2">
</td>
<td>
Introduce la duracion del proceso:
<input name="duracion2">
</td>
</tr>
<tr>
<td>
Introduce el instante de inicio del proceso1:
<input name="llegada3">
</td>
<td>
Introduce la duracion del proceso:
<input name="duracion3">
</td>
</tr>
</table>
<input type="submit" id="mult" value="Calcular" > </input> <input type="reset" value="Borrar">

</form>

<?php

}
else
{

$llega = array($_POST['llegada1'],$_POST['llegada2'],$_POST['llegada3']);
$dura = array($_POST['duracion1'],$_POST['duracion2'],$_POST['duracion3']);

require_once('nusoap.php');
// Create the client instance
$client = new soapclient('"SERVIDOR"', true);
// Check for an error

$proxy = $client->getProxy();

$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
// At this point, you know the call that follows will fail
}

$l = array('procesos' => $llega);
$d = array('duracion' => $dura);
// Call the SOAP method
$result = $proxy->fcfsp($l,$d);
// Check for a fault
if ($proxy->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $proxy->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>El tiempo en tu ciudad </h2><pre>';
var_dump($result);
print_r($result);

echo '</pre>';
}
}

}
print_r($llega);"
  #4 (permalink)  
Antiguo 18/12/2006, 17:17
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Re: web service PHP->c#

Si te llega el "Array" es porque el servicio esta pasando el valor de string de tu array el cual es su nombre Array, tienes que usar implode, o serialize para pasar los datos de tu array como un string.
  #5 (permalink)  
Antiguo 19/12/2006, 09:45
 
Fecha de Ingreso: diciembre-2006
Mensajes: 6
Antigüedad: 17 años, 4 meses
Puntos: 0
Re: web service PHP->c#

He provado con el implode, y visualizando las cadenas en php, me devuelve el array bien, pero al llamar al web service y mandarle las cadenas me devuelve el siguiente error:
wsdl error: phpType is struct, but value is not an array: see debug output for details
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 05:41.