Web Service - this gets error . can anyone see why?
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! Anyway, the resulting page give an error and I cant see why because whats going in seems perfectly logical for what the web service is supposed to do. Heres the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However heres what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And its highlighting the toCurrency line as the one with the error.Huh?If the fromCurrency line is correct, how come the next line isnt?Can anyone see whats wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Web Service - this gets error . can anyone see why?
Mike, Did you try the enumerated type work around that Tom Jordahl posted? cfscript ws = CreateObject(webservice,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 Regards Stephen [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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! Anyway, the resulting page give an error and I cant see why because whats going in seems perfectly logical for what the web service is supposed to do. Heres the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However heres what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And its highlighting the toCurrency line as the one with the error.Huh?If the fromCurrency line is correct, how come the next line isnt?Can anyone see whats wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Web Service - this gets error . can anyone see why?
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! 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. Here's the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However here's what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And it's highlighting the toCurrency line as the one with the error.Huh? If the 'fromCurrency line is correct, how come the next line isn't?Can anyone see what's wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Web Service - this gets error . can anyone see why?
Hi Mike, I'm a bit of a novice at this stuff but I have found that just putting the webservice URL into my browser and then taking a look at the XML displayed is a useful way to solve these kind of issues if there is no better documentation. >From a quick look I would say that rather then two separate arguments, ConversionRate is expecting one structure that contains the 'from' and 'to' currencies. HTH Michael Traher -Original Message- From: Mike Kear [mailto:[EMAIL PROTECTED] Sent: 02 February 2004 07:51 To: CF-Talk Subject: Web Service - this gets error . can anyone see why? 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! 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. Here's the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However here's what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And it's highlighting the toCurrency line as the one with the error. Huh? If the 'fromCurrency line is correct, how come the next line isn't? Can anyone see what's wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Web Service - this gets error . can anyone see why?
Mike, The issue you have is that Currency, which is the data type for fromCurrency and toCurrency is an enumerated data type. There is a issue with CF/Axis and enumerated types.I believe that Macromedia is aware of it, but have no idea what the status is or if there is a decent work around. I've been trying to sort out an issue with an enumerated data type on a web service I'm trying to access and as yet I haven't had been able to get a solution, other than to hard/hand code the soap packet and pass it via cfhttp to the webservice. Not a usable solution unfortunately. The other solution that someone suggested was to import the web service and rewrite it to accept strings/numerics and post it out to the actual web service (I think I got that right).Again not really a usable solution.Why should you have to rewrite someone else's web service... :o{ If get a sensible solution, I would love to know! Regards Stephen Mike Kear wrote: 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! 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. Here's the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However here's what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And it's highlighting the toCurrency line as the one with the error.Huh? If the 'fromCurrency line is correct, how come the next line isn't?Can anyone see what's wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Web Service - this gets error . can anyone see why?
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 Hope this helps. -- Tom Jordahl Macromedia Server Development -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 6:58 AM To: CF-Talk Subject: Re: Web Service - this gets error . can anyone see why? Mike, The issue you have is that Currency, which is the data type for fromCurrency and toCurrency is an enumerated data type. There is a issue with CF/Axis and enumerated types.I believe that Macromedia is aware of it, but have no idea what the status is or if there is a decent work around. I've been trying to sort out an issue with an enumerated data type on a web service I'm trying to access and as yet I haven't had been able to get a solution, other than to hard/hand code the soap packet and pass it via cfhttp to the webservice. Not a usable solution unfortunately. The other solution that someone suggested was to import the web service and rewrite it to accept strings/numerics and post it out to the actual web service (I think I got that right).Again not really a usable solution.Why should you have to rewrite someone else's web service... :o{ If get a sensible solution, I would love to know! Regards Stephen Mike Kear wrote: I want to consume a web service for converting currencies(at http://www.webservicex.net/CurrencyConvertor.asmx?wsdl 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! 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. Here's the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However here's what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And it's highlighting the toCurrency line as the one with the error. Huh? If the 'fromCurrency line is correct, how come the next line isn't? Can anyone see what's wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com http://afpwebworks.com _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Web Service - this gets error . can anyone see why?
WebserviceX.NET is under maintenance. This site will be up soon Sorry for this inconvenience. Webservices Users ,Please use following IP addresstill maintenance complete. http://66.165.154.102/[Service Name] -Original Message- From: Tom Jordahl [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 9:45 AM To: CF-Talk Subject: RE: Web Service - this gets error . can anyone see why? 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 Hope this helps. -- Tom Jordahl Macromedia Server Development -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 6:58 AM To: CF-Talk Subject: Re: Web Service - this gets error . can anyone see why? Mike, The issue you have is that Currency, which is the data type for fromCurrency and toCurrency is an enumerated data type. There is a issue with CF/Axis and enumerated types.I believe that Macromedia is aware of it, but have no idea what the status is or if there is a decent work around. I've been trying to sort out an issue with an enumerated data type on a web service I'm trying to access and as yet I haven't had been able to get a solution, other than to hard/hand code the soap packet and pass it via cfhttp to the webservice. Not a usable solution unfortunately. The other solution that someone suggested was to import the web service and rewrite it to accept strings/numerics and post it out to the actual web service (I think I got that right).Again not really a usable solution.Why should you have to rewrite someone else's web service... :o{ If get a sensible solution, I would love to know! Regards Stephen Mike Kear wrote: I want to consume a web service for converting currencies(at http://www.webservicex.net/CurrencyConvertor.asmx?wsdl 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! 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. Here's the code that Dreamweaver wrote: cfinvoke webservice=http://www.webservicex.net/CurrencyConvertor.asmx?WSDL method=conversionRate returnvariable=conversionRateRet cfinvokeargument name=fromCurrency value=GBP/ cfinvokeargument name=toCurrency value=USD/ /cfinvoke Which (I thought) should take the input value GBP and work out a conversion to USD, and return a variable #conversionRateRet#which will be a number such as 1.02, being the conversion rate. However here's what I get: [quote] Could not perform web service invocation conversionRate because java.lang.IllegalArgumentException: argument type mismatch [/quote] And it's highlighting the toCurrency line as the one with the error. Huh? If the 'fromCurrency line is correct, how come the next line isn't? Can anyone see what's wrong?Or is there something else I have to do on the page? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com http://afpwebworks.com _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]