oop - Creating a custom object in PHP, that is sent to a SOAP service -
i trying build customer object in php , send asmx web service. works fine except build array inside php. when send web-service last order history appears.
here contract specified web service. note pizza-code , not actual code contract contain sensitive data.
public class customer { public int customerid { get; set;} public int name { get; set;} public int surname { get; set;} public orderhistory history { get; set;} } public class orderhistory { public int numberoforders { get;set;} public orders[] orders { get;set;} } public class orders { public int orderid { get;set;} public decimal total {get;set;} }
here how build php object.
$params_create_save = array("customer" => array("customerid" => "111", "name" => "joe", "surname" => "soap", "history" => array("numberoforders" => "10", "orders" => array("ordersid" => "1" "total" => "500.00"), "orders" => array("orderid" => "1", "total" => "200.00"), ), ), ), ), ),
questions:
does above php correct? missing something?
can create seperate order history object , assign parent. if yes please can provide me small sample code?
is there other ways can build object?
thanks taking time @ this! -e-
Comments
Post a Comment