server-webapi-code-09-eBayCaller.php / php
<?php exit('FILL IN YOUR DEV TOKENS!'); appID = ''; token = ''; //api.sandbox.ebay.com/wsapi'; version = "405"; function calleBay(request, appID, endPoint; endPoint?callname=appID&version=length = strlen(headers = array(); headers[] = "Content-Type: text/xml"; length"; ch, CURLOPT_URL, ch, CURLOPT_HEADER, false); curl_setopt(headers); curl_setopt(ch, CURLOPT_POSTFIELDS, ch, CURLOPT_RETURNTRANSFER, true); curl_setopt(ch, CURLOPT_SSL_VERIFYPEER, false); ch); curl_close(returnRAW == TRUE) { return xml = simplexml_load_string(newXML = newXML; } } function generateRequest(appID, endPoint, appID, token; <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <RequesterCredentials soapenv:mustUnderstand="0" xmlns="urn:ebay:apis:eBLBaseComponents"> <eBayAuthToken>token</eBayAuthToken> <ns:Credentials xmlns:ns="urn:ebay:apis:eBLBaseComponents"> <ns:DevId></ns:DevId> <ns:AppId>appID</ns:AppId> <ns:AuthCert></ns:AuthCert> </ns:Credentials> </RequesterCredentials> </soapenv:Header> body </soapenv:Envelope> XMLBLOCK; return callName, body = "<soapenv:Body>\n"; callName}Request xmlns=\"urn:ebay:apis:eBLBaseComponents\">\n"; foreach (key => body .= "<ns1:value</ns1:body .= "</{body .= "</soapenv:Body>"; return callName, depth = 0) { prefix = str_repeat("\t", depth == 0) { <soapenv:Body>\n"; body .= "<{attributes AS value) { if (is_array(body .= <ns1:key xmlns:ns1=\"urn:ebay:apis:eBLBaseComponents\">\n"; prefix . advGenerateBody(value, (body .= </ns1:key>\n"; }else { prefix . "<ns1:value</ns1:depth == 0) { callName}Request>\n"; </soapenv:Body>"; } return body; } ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.