House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

EBay API issues

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phillip Vector
07/02/2009 01:03 PM

So I downloaded some sample code for sending a SOAP command to the servers and I get back a response (the time).. So it works in that sense. But all it gives me in the time.. Code is as follows... ========================================================= <cfset ebayXMLObj = xmlparse(ebayHeaderXML)> <cfscript> // set the header using addSOAPRequestHeader.. an added function to CF MX 7.0 addSOAPRequestHeader(ebayWS, "urn:ebay:apis:eBLBaseComponents", "RequesterCredentials", "#ebayXMLObj#", false); </cfscript> <cfscript> // set the end point using javas _setProperty ebayWS._setProperty("javax.xml.rpc.service.endpoint.address","https://api.sandbox.ebay.com/wsapi?callname=#methodToCall#&siteid=#SiteID#&appid=#AppID#&version=#version#&Routing=#routing#"); // build geteBayOfficialTimeRequest.. timeRequest = StructNew(); timeRequest.version = variables.version; </cfscript> <!--- call the webservice ---> <cfinvoke webservice="#ebayWS#" method="#methodToCall#" returnvariable="time">   <cfinvokeargument name="geteBayOfficialTimeRequest" value="#timeRequest#"> </cfinvoke> <!--- save the output //---> <cfset eBayDateTime=time.getTimeStamp().getTime()> <p>Official eBay Date(dd.mm.yyyy)/Time(HH:mm:ss): <cfoutput>#lsDateFormat(eBayDateTime,"dd.mm.yyyy")# #lsTimeFormat(eBayDateTime,"HH:mm:ss")#</cfoutput></p> ========================================================= So I'm looking at this and I need to code it to add an item.. I got how to set the methodtocall so that I can add items and such.. But what I'm confused by is.. // build geteBayOfficialTimeRequest.. timeRequest = StructNew(); timeRequest.version = variables.version; Is this really nesserary? Is that setting up the variable that gets returned or some such? Mainly, can someone show me a "soap light" version of what is nesserary and what isn't when calling ebay?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Ben Densmore
07/02/2009 01:38 PM

that struct is building up the parameters to send to the SOAP Request. So, if the API requires the following parameters: <version /> <CategoryID /> <ItemName /> Then in your struct you have: <cfscript>   myRequest = structNew();   myRequest.version = "623"; myRequest.CategoryID = 20; myRequest.ItemName = "Some Item Name"; </cfscript> Now when you use the cfinvoke tag and pass the argument to it as a struct, the Soap Request takes those parameters one by one as if you were creating the elements individually. I ran into serious issues because a lot of these parameters are complex types that map to a custom Object. Even when I would try to set the parameters to be of the Object type it expected the whole thing went south. I was going to try and go the route of creating my soap requests in xml format using cfsavecontent then just use cfhttp to pass the soap requests in but I ran out of time. If you have any other questions I can try and help you out with what I know, which isn't a whole lot. Thanks, Ben On Thu, Jul 2, 2009 at 1:02 PM, Phillip Vector <vector@mostdeadlygame.com>wrote: ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

March 21, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31