save controller class without getting any error?

Hi this my generated apex code can any help me on writing apex controller i am tring controller class like this but getting error:

public class AsyncWwwWebservicexNet1 {     public class ConversionRateResponse_elementFuture extends System.WebServiceCalloutFuture {         public Double getValue() {             wwwWebservicexNet1.ConversionRateResponse_element response = (wwwWebservicexNet1.ConversionRateResponse_element)System.WebServiceCallout.endInvoke(this);             return response.ConversionRateResult;         }     }     public class AsyncCurrencyConvertorSoap {         public String endpoint_x = 'http://www.webservicex.net/CurrencyConvertor.asmx';         public Map<String,String> inputHttpHeaders_x;         public String clientCertName_x;         public Integer timeout_x;         private String[] ns_map_type_info = new String[]{'http://www.webserviceX.NET/', 'wwwWebservicexNet1'};         public AsyncWwwWebservicexNet1.ConversionRateResponse_elementFuture beginConversionRate(System.Continuation continuation,String FromCurrency,String ToCurrency) {             wwwWebservicexNet1.ConversionRate_element request_x = new wwwWebservicexNet1.ConversionRate_element();             request_x.FromCurrency = FromCurrency;             request_x.ToCurrency = ToCurrency;             return (AsyncWwwWebservicexNet1.ConversionRateResponse_elementFuture) System.WebServiceCallout.beginInvoke(               this,               request_x,               AsyncWwwWebservicexNet1.ConversionRateResponse_elementFuture.class,               continuation,               new String[]{endpoint_x,               'http://www.webserviceX.NET/ConversionRate',               'http://www.webserviceX.NET/',               'ConversionRate',               'http://www.webserviceX.NET/',               'ConversionRateResponse',               'wwwWebservicexNet1.ConversionRateResponse_element'}             );         }     } }  public class wwwWebservicexNet1 {     public class ConversionRateResponse_element {         public Double ConversionRateResult;         private String[] ConversionRateResult_type_info = new String[]{'ConversionRateResult','http://www.webserviceX.NET/',null,'1','1','false'};         private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET/','true','false'};         private String[] field_order_type_info = new String[]{'ConversionRateResult'};     }     public class ConversionRate_element {         public String FromCurrency;         public String ToCurrency;         private String[] FromCurrency_type_info = new String[]{'FromCurrency','http://www.webserviceX.NET/',null,'1','1','false'};         private String[] ToCurrency_type_info = new String[]{'ToCurrency','http://www.webserviceX.NET/',null,'1','1','false'};         private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET/','true','false'};         private String[] field_order_type_info = new String[]{'FromCurrency','ToCurrency'};     }     public class CurrencyConvertorSoap {         public String endpoint_x = 'http://www.webservicex.net/CurrencyConvertor.asmx';         public Map<String,String> inputHttpHeaders_x;         public Map<String,String> outputHttpHeaders_x;         public String clientCertName_x;         public String clientCert_x;         public String clientCertPasswd_x;         public Integer timeout_x;         private String[] ns_map_type_info = new String[]{'http://www.webserviceX.NET/', 'wwwWebservicexNet1'};         public Double ConversionRate(String FromCurrency,String ToCurrency) {             wwwWebservicexNet1.ConversionRate_element request_x = new wwwWebservicexNet1.ConversionRate_element();             request_x.FromCurrency = FromCurrency;             request_x.ToCurrency = ToCurrency;             wwwWebservicexNet1.ConversionRateResponse_element response_x;             Map<String, wwwWebservicexNet1.ConversionRateResponse_element> response_map_x = new Map<String, wwwWebservicexNet1.ConversionRateResponse_element>();             response_map_x.put('response_x', response_x);             WebServiceCallout.invoke(               this,               request_x,               response_map_x,               new String[]{endpoint_x,               'http://www.webserviceX.NET/ConversionRate',               'http://www.webserviceX.NET/',               'ConversionRate',               'http://www.webserviceX.NET/',               'ConversionRateResponse',               'wwwWebservicexNet1.ConversionRateResponse_element'}             );             response_x = response_map_x.get('response_x');             return response_x.ConversionRateResult;         }     } 

My Controller class:

public class currencyconvert{ public string fromcurrency{get;set;} public string tocurrency{get;set;} public double result{get;set;}   public List<SelectOption> getCountrycodes() {         List<SelectOption> countrycodes = new List<SelectOption>();         countrycodes.add(new SelectOption('','-None-'));         countrycodes.add(new SelectOption('AFA','AFA'));         countrycodes.add(new SelectOption('INR','INR'));         countrycodes.add(new SelectOption('RUB','RUB'));         countrycodes.add(new SelectOption('USD','USD'));         countrycodes.add(new SelectOption('ZWD','ZWD'));         return countrycodes;     }   public List<SelectOption> getCountry() {         List<SelectOption> countrycodes = new List<SelectOption>();         countrycodes.add(new SelectOption('','-None-'));         countrycodes.add(new SelectOption('VUV','VUV'));         countrycodes.add(new SelectOption('TTD','TTD'));         countrycodes.add(new SelectOption('TWD','TWD'));         countrycodes.add(new SelectOption('USD','USD'));         countrycodes.add(new SelectOption('AFA','AFA'));         return countrycodes;     }  public double convert(){ wwwWebservicexNet1 web = new wwwWebservicexNet1(); result = web.ConversionRate(fromcurrency,tocurrency); return null; } } 

error:

Error: Compile Error: Method does not exist or incorrect signature: [wwwWebservicexNet1].ConversionRate(String, String) at line 30 column 10     

Replay

I dont want to write the whole class for you but the error you are getting is because the function ConversionRate is under class CurrencyConvertorSoap which is in turn under class wwwWebservicexNet1. So you should create instance of the inner class then call the function. Something like this -

wwwWebservicexNet1.CurrencyConvertorSoap   web = new wwwWebservicexNet1.CurrencyConvertorSoap();
result = web.ConversionRate(fromcurrency,tocurrency);

Category: apex Time: 2016-07-31 Views: 73
Tags: apex

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.236 (s). 12 q(s)