Geoff asks:
This article: http://www.adobe.com/go/13115e61 states that dns lookups for cfhttp requests are cached forever by default.Yes and no. ColdFusion won't cache the result of the web service call, what it will do is cache the WSDL of the web service. So any change to methods (addition, subtraction, modification) will not be usable by ColdFusion. Luckily you can just go into the ColdFusion administration and refresh or remove the cache. I do wish cfinvoke had an optional argument to let me refresh the cache via the call. It isn't something I'd use during production, but during testing it would be nice. I'm not sure if the Administrator API allows for this. One day soon I'm going to generate the CFC docs as PDF (using this) and will put them online so they are easier to find.Is the behaviour the same for cfinvoke too? (That is if I'm invoking a web service for example)
So for my readers, I know I've blogged this before, but I think I see this question/problem once a week, so forgive me for repeating myself.
Edited As a follow up. I had misread this question a bit. He wants to know if cfinvoke will cache the dsn look up in a case like this:
<cfinvoke
webservice="https://www.secpay.com/java-bin/services/SECCardService?wsdl"
method="validateCardFull" etc>
I'm checking into this, and will post the answer to the main entry.
Archived Comments
Regarding the chached webservice, here is a method for clearing that cache programatically:
<cfscript>
ws = "http://domain.com/myservice...";
RpcService = CreateObject("java","coldfusion.server.ServiceFactory").RpcService;
RpcService.refreshWebService(ws);
</cfscript>
Ray - you can use the service factory to refresh a specific web service. See this post:
http://mkruger.cfwebtools.c...
Cool, but I wonder if there is an Admin API way to do it, which would be more official.
I -always- try to warn folks - the ServiceFactory is cool, but 100% unsupported.
Anyway, I'm going to run some PDF dumps of the Admin CFC and post them. As far as I know, there is no documentation like this. The livedocs DO talk about it, but don't tell you all the methods you can do. (AFAIK)
Also guys, note that I edited the entry. The original reader had a different concern than what I thought he meant.
I'd interpret the question slightly different and stick my neck out and say yes, it would apply to web services too. I think the question is more to do with DNS caching as opposed to web service caching. As the location of the webservice is specified by a fully qualified domain names then Java will cache the IP of that fqdn indefinitely (if i'm reading the quoted technote correctly) so if the IP changes then the endpoint of the ws would still be at the old IP and not the new one until CF/Jrun is restarted
Hey John, read the entry again. I updated it earlier to reflect this. You are right, that is what he is concerned with, and I pinged a contact on the CF team. The tech note is VERY clear in saying cfhttp only. You would ASSUME the cfinvoke would use the same core code, but it may not.
The usage of the service factory is also not supported in BlueDragon for those use other than Adobe for CF solutions.
that web services caching bit me badly when Amazon moved their European IPs. Took me *ages* to work out what was happening ...
in my defence, it was the first web services stuff I'd ever written.