1

i want to split my response, I got my response as array. Could Anyone pls help me.

This is my output:

enter image description here

This is a code i written in developer console.

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

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

h.Username='*****';

h.Password='*****';

h.Tracer='****';

testCls.Header = h;

wwwXigniteComServices.Currencies ListCurrenciesResult = testCls.ListCurrencies();

System.debug(ListCurrenciesResult);
  • I am pretty sure that wwwXigniteComServices.Currencies is some kind of class with properties, that store all the required information. Just check what's inside – kurunve Jan 14 '16 at 8:04
  • Yes, it stored all needed info. Like, Countries, Countries_type_info,Digital, Digital_type_info, Message, Message_type_info, Name_type_info, Plural, Plural_type_info,Symbol=ADP,Symbol_type_info. \ – Jana Shree Jan 14 '16 at 8:11
  • But i don't need this response as array. – Jana Shree Jan 14 '16 at 8:12
  • <Currency> <Symbol>ADP</Symbol> <Name>Andorran peseta</Name> <Plural>Andorran pesetas</Plural> <Active>false</Active> <Digital>false</Digital> </Currency> – Jana Shree Jan 14 '16 at 8:12
  • so, what do you need? – kurunve Jan 14 '16 at 8:13
1

The signature of ListCurrencies() are the corresponding return types:

public wwwXigniteComServices.Currencies ListCurrencies() { ... }

public class Currencies {
    public String Outcome;
    public String Message;
    public String Identity;
    public Double Delay;
    // ..._type_info    
    public wwwXigniteComServices.ArrayOfCurrency CurrencyList;
    // ..._type_info
}

public class ArrayOfCurrency {
    public wwwXigniteComServices.Currency_x[] Currency_x;
    // ..._type_info
}

public class Currency_x {
    public String Symbol;
    public String Name;
    public String Plural;
    public Boolean Active;
    public Boolean Digital;
    public String Message;
    public wwwXigniteComServices.ArrayOfCountry Countries;
    // ..._type_info
}

So you've got all the details you need there. Expanding it out from the end of your sample code:

wwwXigniteComServices.Currencies ListCurrenciesResult = testCls.ListCurrencies();


for(wwwXigniteComServices.Currency_x cur : ListCurrenciesResult.CurrencyList.Currency_c) {
    System.debug(cur.Symbol);
    System.debug(cur.Name);
    System.debug(cur.Plural);
    System.debug(cur.Active);
    System.debug(cur.Digital);
    System.debug(cur.Message);
}

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.