I'm having trouble passing a parameter list in php in a web service c #.
The Web services in c# is as follows:
[WebMethod ()]
public string IncluirOrcamento (List <ProdutosOrcamento> Products)
{
...
}
Where ProdutosOrcamento is a class in c# represented in this way ..
public class ProdutosOrcamento
{
public string ProductCode {get; sets;}
public Nullable <double> quantity {get; sets;}
}
Done this way in php ...
<? php
require_once ('/ lib / nusoap.php');
$ array = array ("Product" => array ("ProdutosOrcamento" => array (
'ProductCode' => '44 ',
'quantity' => '2 ')
"ProdutosOrcamento" => array (
'ProductCode' => '55 ',
'quantity' => '13 ')));
/ / print_r ($ array);
$ wsdl = "http://localhost:33328/KasviService.asmx?WSDL";
$ function = "IncluirOrcamento";
$ client = new nusoap_client ("http://localhost:33328/KasviService.asmx?WSDL", array ('location' => 'http://localhost:33328/KasviService.asmx?WSDL'));
$ result = $ client-> call ("IncluirOrcamento", $ array);
if ($ client-> fault) {
print_r ($ result);
else {}
$ err = $ client-> getError ();
if ($ err) {
echo 'Error <h2> </ h2> <pre>'. $ err. '</ pre>';
else {}
print_r ($ result);
}
}
?>
I pass an array of objects, but my problem is that only considered the last object in the array, and I can not build a list with lots of objects. Does anyone know how to pass a list of objects in php web services for C #?