children('http://schemas.xmlsoap.org/soap/envelope/')->children('urn:ebay:apis:eBLBaseComponents'); return $newXML; } } function generateRequest($body) { global $appID, $version, $endPoint, $devID, $appID, $cert, $token; $request = <<< XMLBLOCK $token $devID $appID $cert $body XMLBLOCK; return $request; } function generateBody($callName, $attributes) { $body = "\n"; $body .= "<{$callName}Request xmlns=\"urn:ebay:apis:eBLBaseComponents\">\n"; foreach ($attributes AS $key => $value) { $body .= "$value\n"; } $body .= "\n"; $body .= ""; return $body; } function advGenerateBody($callName, $attributes, $depth = 0) { $body = ""; $prefix = str_repeat("\t", $depth); if ($depth == 0) { $body .= "\n"; $body .= "<{$callName}Request xmlns=\"urn:ebay:apis:eBLBaseComponents\">\n"; } foreach ($attributes AS $key => $value) { if (is_array($value)) { $body .= $prefix . "\n"; $body .= $prefix . advGenerateBody($callName, $value, ($depth + 1)); $body .= $prefix . "\n"; }else { $body .= $prefix . "$value\n"; } } if ($depth == 0) { $body .= "\n"; $body .= ""; } return $body; } ?>