I want to consume a web service for converting currencies (at
http://www.webservicex.net/CurrencyConvertor.asmx?wsdl ) and I used the
EXCELLENT implementation in DreamweaverMX to write the code. That drag and
drop is an absolute gem for this!
Certainly makes using WS a lot easier! :)
Anyway, the resulting page give an error and I cant see why because what's
going in seems perfectly logical for what the web service is supposed to do.
The problem is that the Web Service defines a restricted enumeration on the base type of string and currently CFMX does not support that. You can get around this but it's fairly messy...
You can use wsdl2java on the WSDL to create the Java stubs. This will create a Currency.java file - compile it and move it to the CFMX class path so that you can create an instance of it directly within your CF page:
<cfset gbp = createObject("java","NET.webserviceX.www.Currency").fromString("GBP")/>
<cfset usd = createObject("java","NET.webserviceX.www.Currency").fromString("USD")/>
<cfinvoke webservice="http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"
method="conversionRate" returnvariable="conversionRateRet">
<cfinvokeargument name="fromCurrency" value="#gbp#"/>
<cfinvokeargument name="toCurrency" value="#usd#"/>
</cfinvoke>
<cfdump label="conversionRateRet" var="#conversionRateRet#"/>
Regards, Sean
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
