Has anyone  managed to consume a Currency Conversion web service under CFMX
yet?  

Before you all send me listings of xmethods currency converters,  I've
looked at them all and none of them work under CF without a lot of stuffing
about. Other people have apparently got a currency conversion working
because of the number of people who told me there was nothing to it.    Back
in February this year, I spent nearly two days messing about trying to make
it work and eventually gave up, putting the issue on the back of the queue
until it came up to the top of the pile again.   Now it's come back up.

For those who missed it,  back in February,  Tom Jordahl from Team
Macromedia said the following back then, which I never managed to make work.
(I assume because I didn't follow his instructions or something but I
decided there were easier things to do and gave up):

[QUOTING Tom Jordahl]

  Mike,
  Yes, enumeration is the problem here.
  I have fixed this, and I am working to try and get this fix available to
customers.  I apologize for this bug.  No test for a situation means it
doesn't work.   Now we have an enumeration test. :-)
  In the mean time, try this workaround:
  <cfscript>
    ws = CreateObject("webservice",
  http://www.webservicex.net/CurrencyConvertor.asmx?wsdl
  <http://www.webservicex.net/CurrencyConvertor.asmx?wsdl> );
    enum = CreateObject("java", "NET.webserviceX.www.Currency");
    argFrom = enum.fromString("GBP");
    argTo = enum.fromString("USD");
    result = ws.ConversionRate(argFrom, argTo);
  </cfscript>

  The above workaround has one tricky problem however; you will need to copy

  the class NET.webserviceX.www.Currency to a directory on the ColdFusion
  classpath.  I suggest C:\CFusionMX\wwwroot\WEB-INF\classes (adjust to your

  installation directory).

  Here is how to do that:

  1. Run this page at least once and get the Class Not Found error.
  2. Go to the CFusionMX/stubs directory and find the WS-????????
  directory that has the NET sub directory.
  3. Copy the NET directory to wwwroot/WEB-INF/class.
  4. Delete all the .class files in the NET/webserviceX.www directory
  EXCEPT Currency.class.

  Sean Cornfield originally brought the issue up tome because of a thread on

  CFGURU .  Here is his web log posting on how to debug these issues:
  http://www.corfield.org/blog/past/2004_01.html#000252
  <http://www.corfield.org/blog/past/2004_01.html#000252>
[/END QUOTE]

I tried that, and I have about a dozen NET directories, with references to
currency conversion there, and moving one after the other still meant I got
error messages.

All I want to do is convert currency values on the fly when a user puts his
preferred currency in the session vars, so all prices display on the page in
his chosen currency.



Cheers

Mike Kear

AFP Webworks

Windsor, NSW, Australia

http://afpwebworks.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to