FALCONSEYE
Programmer
has anyone worked with ebay's Soap API ? I saw some example CF code at developer.ebay.com but it doesn't work for some reason. Anyone know how to get a eBayAuthToken ?
thanks
thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<cftry>
<cfscript>
// create the object used to send XML to eBay API
xmlObjServer = CreateObject("COM", "msxml2.serverxmlhttp");
// set the request headers for the HTTP request
if (variables.sendToSandbox eq '1') { // send to the sandbox for testing
// set SANDBOX variables in request headers
variables.Urlxml="[URL unfurl="true"]https://api.sandbox.ebay.com/ws/api.dll";[/URL]
variables.logPass = "YOURPASSWORDHERE";
xmlObjServer.open( "post", variables.Urlxml,"false");
xmlObjServer.setRequestHeader("X-EBAY-API-SESSION-CERTIFICATE", variables.logPass);
xmlObjServer.setRequestHeader("X-EBAY-API-COMPATIBILITY-LEVEL", "YOUR-COMPATLEVEL-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-DEV-NAME", "YOUR-DEVNAME-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-APP-NAME", "YOUR-APPNAME-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-CERT-NAME", "YOUR-CERTNAME-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-MOTORATTRIBUTES", "1");
xmlObjServer.setRequestHeader("X-EBAY-API-CALL-NAME", variables.callName);
xmlObjServer.setRequestHeader("X-EBAY-API-SITEID", variables.siteId);
xmlObjServer.setRequestHeader("X-EBAY-API-DETAIL-LEVEL", variables.detailLevel);
} else {
// set PRODUCTION variables in request headers
variables.Urlxml="[URL unfurl="true"]https://api.ebay.com/ws/api.dll";[/URL]
variables.logPass = "YOURPASSWORDHERE";
xmlObjServer.open( "post", variables.Urlxml,"false");
xmlObjServer.setRequestHeader("X-EBAY-API-SESSION-CERTIFICATE", variables.logPass);
xmlObjServer.setRequestHeader("X-EBAY-API-COMPATIBILITY-LEVEL", "YOUR-COMPATLEVEL-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-DEV-NAME", "YOUR-DEVNAME-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-APP-NAME", "YOUR-APPNAME-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-CERT-NAME", "YOUR-CERTNAME-HERE");
xmlObjServer.setRequestHeader("X-EBAY-API-MOTORATTRIBUTES", "1");
xmlObjServer.setRequestHeader("X-EBAY-API-CALL-NAME", variables.callName);
xmlObjServer.setRequestHeader("X-EBAY-API-SITEID", variables.siteId);
xmlObjServer.setRequestHeader("X-EBAY-API-DETAIL-LEVEL", variables.detailLevel);
}
</cfscript>
<!--- send the XML call itself via the COM Obj. variables.xml contains the XML for the API call itself. --->
<cfset x = xmlObjServer.send( variables.xml )>
<!--- retrieve the returned XML from the Obj --->
<cfset variables.respXml = xmlObjServer.responseXML>
<cfset variables.respXml = variables.respXml.xml>
<cfset xmlObjServer = "">
<!--- Log the API call if so desired --->
<cfinclude template="LogAPICall.cfm">
<cfcatch>
<!--- perform exception handling here --->
</cfcatch>
</cftry>
<!--- process the returned XML, turning it into a struct-type object.
see [URL unfurl="true"]http://tutorial131.easycfm.com/[/URL] for source code for the custom tag. --->
<cf_soxml action="XML2CF" input="#variables.respXml#" output="variables.Obj" progId="Msxml2.DOMDocument.4.0">