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:

  1. does above php correct? missing something?

  2. can create seperate order history object , assign parent. if yes please can provide me small sample code?

  3. is there other ways can build object?

thanks taking time @ this! -e-


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -