I have a method in php that I need to call and send some variable to it. This is where I am calling the method:
$param = array (
'AuthenticationKey' => $authkey,
'vconfig' => ?,
'vcondition' =>$vcondition,
'ZipCode' =>$ZipCode,
'VersionDate' => $currentdate,
);
$result = $client->call('GetVehicleValuesByVehicleConfiguration', array('parameters' => $param), '', '', false, true);
One of the variable that I am sending to this method is class ('vconfig' => ?
) this one. I am not sure how to initialize that class, its members, and send it as a parameter to this method.
I have used this to initialize the class:
$vconfig = new $client.VehicleConfiguration;
but another method is giving me some values that I need to pass to this class, I am not sure how. I have made the code working in C# but don't know how to make it in php. That is what I am talking about in C#.
ServiceReference1.VehicleConfiguration vconfig = new ServiceReference1.VehicleConfiguration();
var getValue2 = soapClient.GetVehicleConfigurationByVehicleId(AuthenticationId, ap, 2, "01602", current);
//dont know how to do this part in php
vconfig.Year = getValue2.Year;
vconfig.Make = getValue2.Make;
vconfig.Model = getValue2.Model;
vconfig.Trim = getValue2.Trim;
vconfig.Mileage = getValue2.Mileage;
vconfig.OptionalEquipment = getValue2.OptionalEquipment;
I don't know how to do the last part vconfig.Year = getValue2.Year;
in php This is the code of web service class that I need to give value to the elements:
public partial class VehicleConfiguration : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
[System.NonSerializedAttribute()]
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private int IdField;
private string VINField;
private ConsumeKbbAPI.ServiceReference1.IdStringPair YearField;
private ConsumeKbbAPI.ServiceReference1.IdStringPair MakeField;
private ConsumeKbbAPI.ServiceReference1.IdStringPair ModelField;
private ConsumeKbbAPI.ServiceReference1.IdStringPair TrimField;
//private ConsumeKbbAPI.ServiceReference1.VehicleTrim TrimField;
private int MileageField;
It depends on your Configuration class, but if you have public members as in C#, this could work:
<?php
//Example of class
class Configuration {
public $year;
public $model;
//and so on
}
//Example of instantiation
$vconfig = new Configuration();
//Here's the syntax you're looking for
$vconfig->year = 2002;
$vconfig->model = "Something";