(warning: cold fusion technospeak ahead)
So I’m developing an application that makes use of the eBay API.
In this application, there is a need to send well-formatted xml to eBay.
In addition, all requests must include certain HTTP Header information, so that eBay knows just who the hell is talking to them.
Why is this a problem? well, in CFMX, you can send a type XML parameter via CFHTTP.
The problem is that if you have a type XML parameter, you’re not allowed to send anything else (I’ve no idea why).
So, why don’t I just send the XML as a formfield or something?
Because I need to send the XML as content, not as a header.
If I try and send it as type CGI, or URL, or FormField, or Cookie, I get no response back.
Interestingly, if I send a .xml file (using type=“file”), I get a whole new error (bad developerID in the session certificate --- but I’ve confirmed that it is indeed, valid, so I’ve no idea why I get that error).
So it looks like I can’t use CFHTTP, which is really, really odd.
So I’ve resorted to calling the Microsoft ServerHTTPXML COM Object, and using that.
Which works just peachy, thanks.
Here’s the working code (where #string# is a properly formed XML document) (by the way, we’re not here to critique my naming conventions --- these are temporary for a prototype):
And here’s the non-working CFHTTP code:
My question to the world is then: Is there a way to send content via CFHTTP?
If you’re familiar with the eBay API, is there a reason why when I send an XML file via CFHTTP, it gives me nice error code in response, and when I send it in any other format, I get nothing back at all (and I know the DevID is right, because the COM object call works, using the same one).