1

I don't know how to call method from wsdl file apex class.This is wsdl file Anyone please help me for this.Now i want call "ConvertHistoricalValue" method for get response. How can i call it?

wwwXigniteComServices.XigniteGlobalCurrenciesSoap testCls = new wwwXigniteComServices.XigniteGlobalCurrenciesSoap();

wwwXigniteComServices.Header h = new wwwXigniteComServices.Header();

h.Username='****';
h.Password='****';
h.Tracer='****';
testCls.Header = h

testCls.GetRealTimeRate('EURUSD');

When i'm trying to call "XigniteGlobalCurrenciesSoap" this method, it shows some error.

The error looks like"System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element Outcome"

Thank you.

  • Can you share you generated Apex wsdl files..? – Ratan Paul Jan 13 '16 at 7:15
  • Sorry sir, i don't know How can i share my apex class file? it contains 1500 lines of code. – Jana Shree Jan 13 '16 at 7:17
  • How can i call some method from this class and get response – Jana Shree Jan 13 '16 at 7:25
  • wwwXigniteComServices.XigniteGlobalCurrenciesSoap testCls = new wwwXigniteComServices.XigniteGlobalCurrenciesSoap(); wwwXigniteComServices.Header h = new wwwXigniteComServices.Header(); h.Username='****'; h.Password='****'; h.Tracer='****'; testCls.Header = h; testCls.GetRealTimeRate('EURUSD'); – Jana Shree Jan 13 '16 at 8:04
0

I pulled down what I think is the the original WSDL from http://globalcurrencies.xignite.com/xGlobalCurrencies.asmx?wsdl and ran it through the custom version of Wsdl2Apex in the FuseIT SFDC Explorer tool. (Disclosure: This is a free tool from my current employer)

I opted to only generate the Apex method for GetRealTimeRate web method. You can get the generated wwwXigniteComServices class.

After adding the Remote Site setting I used a Trail account with the following anonymous Apex code:

wwwXigniteComServices.XigniteGlobalCurrenciesSoap testCls = new wwwXigniteComServices.XigniteGlobalCurrenciesSoap();

wwwXigniteComServices.Header h = new wwwXigniteComServices.Header();
h.Username='daniel.ballinger@example.com';
h.Password='notMyRealPassword';
h.Tracer='51ED22B1IAMWEASELF1CFF9650B4'; //Found value in API Tokens on xignite website
testCls.Header = h;

wwwXigniteComServices.Rate eurUsdRate = testCls.GetRealTimeRate('EURUSD');
System.debug(eurUsdRate);

That came back without a parsing error, although I did hit the unregistered requests limit, so can't show any meaningful output.

  • Sir, my response is in array, Now, i want to split it or parse this response..? – Jana Shree Jan 14 '16 at 7:38
  • Could u pls help me – Jana Shree Jan 14 '16 at 7:39
  • @JanaShree I don't see any response data in the Rate class that would be an array. There is documentation on how to work with Arrays and Lists. They are interchangeable in apex. Other than that, Maybe ask a new question about the specific problem you are having. – Daniel Ballinger Jan 14 '16 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.