Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Currencies Converter Web Service

Posted on 2014-04-02
4
Medium Priority
?
624 Views
Last Modified: 2014-04-03
Hi experts,

I had found a web service to get a change rate between two given currencies.
It first works good, but now (after a host transfer and other minor modifications) I get the message « Web service operation ConversionRate with parameters {GBP,EUR} cannot be found.  ».

Am I doing something wrong ? Web service has changed ?

I have look at the web service provider’s website, but they don’t have many documentation and it is very technical. I am little lost.

Here is the code I use :
	<cfset application.exchangeRate.EURtoUSD = -1>
	<cfset application.exchangeRate.USDtoEUR = -1>
	<cfset application.exchangeRate.GBPtoUSD = -1>
	<cfset application.exchangeRate.USDtoGBP = -1>
	<cfset application.exchangeRate.GBPtoEUR = -1>
	<cfset application.exchangeRate.EURtoGBP = -1>
	<cfset local.service = createObject("webservice", "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")>
	<cfset local.fromCurrency = "GBP">
	<cfset local.toCurrency = "EUR">
	<cfloop condition="application.exchangeRate.GBPtoEUR EQ -1"> <cfset application.exchangeRate.GBPtoEUR = local.service.ConversionRate(local.fromCurrency, local.toCurrency)> </cfloop>
	<cfloop condition="application.exchangeRate.EURtoGBP EQ -1"> <cfset application.exchangeRate.EURtoGBP = local.service.ConversionRate(local.toCurrency, local.fromCurrency)> </cfloop>
	<cfset local.fromCurrency = "GBP">
	<cfset local.toCurrency = "USD">
	<cfloop condition="application.exchangeRate.GBPtoUSD EQ -1"> <cfset application.exchangeRate.GBPtoUSD = local.service.ConversionRate(local.fromCurrency, local.toCurrency)> </cfloop>
	<cfloop condition="application.exchangeRate.USDtoGBP EQ -1"> <cfset application.exchangeRate.USDtoGBP = local.service.ConversionRate(local.toCurrency, local.fromCurrency)> </cfloop>
	<cfset local.fromCurrency = "EUR">
	<cfset local.toCurrency = "USD">
	<cfloop condition="application.exchangeRate.EURtoUSD EQ -1"> <cfset application.exchangeRate.EURtoUSD = local.service.ConversionRate(local.fromCurrency, local.toCurrency)> </cfloop>
	<cfloop condition="application.exchangeRate.USDtoEUR EQ -1"> <cfset application.exchangeRate.USDtoEUR = local.service.ConversionRate(local.toCurrency, local.fromCurrency)> </cfloop>

Open in new window


Thanks a lot for your help.

Adam
0
Comment
Question by:adam1h
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 39972485
Are you using CF10 by any chance?  I ran your code and got that same error w/CF10, due to a change from Axis 1 =>v2.

It works if you set the version back to 1. The 1st time you run it, add "refreshWSDL=true" to generate new stubs. After that you can remove it and use only "wsversion=1"

<cfset args = {refreshWSDL=true, wsversion=1}>
<cfset local.service = createObject("webservice"
               , "http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"
              , args)>
...
0
 

Author Comment

by:adam1h
ID: 39973093
Hi agx,

Indeed we have changed our host and we are now on a cf10 server.

I will try this fix tomorrow.

Thanks
0
 

Author Closing Comment

by:adam1h
ID: 39974494
A great thank you _agx_ , it works perfectly :-)
0
 
LVL 52

Expert Comment

by:_agx_
ID: 39975381
I'm not sure why they chose to default web services to Axis2 instead of 1, like in CF9. Seems to have broken a lot of code like yours ... but glad that fixed it :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question