C# and NUSOAP, blank results
-
Hi i'm working in a C# client proyect, that client call SOAP methos from a PHP NUSOAP this is the method using in PHP (nusoap)
require\_once('lib/nusoap.php'); $server = new soap\_server(); $ns='http://localhost/'; $server->configurewsdl('ApplicationServices',$ns); $server->wsdl->schematargetnamespace=$ns; $server->register('prueba',array('texto' => 'xsd:string'),array('return' => 'xsd:string'),$ns); $POST\_DATA = isset($GLOBALS\['HTTP\_RAW\_POST\_DATA'\]) ? $GLOBALS\['HTTP\_RAW\_POST\_DATA'\] : '';
// pass our posted data (or nothing) to the soap service
$server->service($POST_DATA);function prueba($texto) { $var1 = "Tu texto es: " . $texto; return $var1; } exit();
?>
well, the soap code works fine. Now, the C# client
namespace soap1
{
[System.Web.Services.WebServiceBinding(Namespace = "http://localhost/", Name = "ApplicationServices")]
public class localhost1 : System.Web.Services.Protocols.SoapHttpClientProtocol
{\[System.Diagnostics.DebuggerStepThrough()\] public localhost1() { this.Url = "http://localhost/logeo.php"; } \[System.Web.Services.Protocols.SoapDocumentMethod("http://localhost/logeo.php", RequestNamespace = "http://localhost/", ResponseNamespace = "http://localhost/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)\] public string prueba(string texto) { object\[\] resultado = this.Invoke("prueba", new object \[\] { texto }); return(Convert.ToString(resultado\[0\])); } //\[System.Diagnostics.DebuggerStepThrough\]
}
public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1\_Click(object sender, EventArgs e) { localhost1 app1 = new localhost1(); string s = app1.prueba("pato"); MessageBox.Show(s); }
}
}now, the c# code here, works fine and they detect my php method ¿the problem? well, in that line
string s = app1.prueba("pato");
the "s" variable has in blank, no result, no value return i test the SOAP server code in a SOAP client code and works fine, return a string value, but in this c#, no string value returns. why?? :confused: NOTE: Sorr