During my career I have never had the opportunity to write X++ code that consumes an external web services…
I am trying to get exchange rates from the Swedish Riksbank (the central bank of Sweden) through their web service API (swea.riksbank.se/…/index.htm ).
I add a service reference in AX and enters the URL to the wsdl location (swea.riksbank.se/…/sweaWS.wsdl ). Then I create a class with a method which looks something like this:
public static server Exchrate getRate()
soapClient = new netCurrencyService.SweaWebServicePortTypeClient();
rates = “SEKUSDPMI”;
rates = “SEKGBPPMI”;
conversionrate = soapClient.getLatestInterestAndExchangeRates(“en”, rates);
My problem is that the code does not compile. The call “soapClient.getLatestInterestAndExchangeRates(“en”, rates)” indicates that argument 2 (“rates”) is incorrect. If I enter a string instead the compiler says that the class netCurrencyService.SweaWebServicePortTypeClient doesn’t include this function (“getLatestInterestAndExchangeRates”?).