I'm back and I almost have it.
This may not be the best solution, but I almost have it working
Here's the code
public function __construct($coid, $env, $app_id, $product)
{
$url = APP_ROOT."dev/install/wsdl/my.wsdl";
try{
$soapclient = new SoapClient($url);
//This overwrites the location at the bottom of the WSDL file
$soapclient->__setLocation('http://exampleurl');
$params = array('clientOid' => $coid);
$response =$soapclient->getClientSetup($params);
// This returns an object
$response =$soapclient->getClientSetup($params);
// Convert to an array
$objtoarray = json_decode(json_encode($response), true);
// Add sqare brackets to beginning and end
$tojson = json_encode(array($objtoarray));
$removed = array_shift($objtoarray); // remove clientSetup
$removed2 = array_shift($removed); // remove selectedProducts
print_r($removed2);
echo "--------";
//echo $array['code']['5']['Description'];
var_dump($array);
}catch(Exception $e){
echo $e->getMessage();
}
This returns the following
[
{
0: {
code: "1032",
description: "datapoint 1"
},
1: {
code: "2201",
description: "datapoint 2"
},
2: {
code: "2200",
description: "datapoint 3"
},
3: {
code: "1049",
description: "datapoint 4"
},
]
I need to remove the Index numbers in this case 0 - 3 and add the productUrl: "NO_URL" to all. It should look like this
[
{
code: 1001,
description: "datapoint 1",
productUrl: "NO_URL"
},
{
code: 1089,
description: "datapoint 1",
productUrl: "NO_URL"
},
{
code: 2101,
description: "datapoint 1",
productUrl: "NO_URL"
}
]
If some one could help me get this. I will be happy to buy you a beer!