I am hitting a web service method. This Web service method returns values in the XML format.
When I am trying to get this element. I am getting a single ElementName with the following code in debug mode.
givenwsdl.periodictableSoap proxyClass = new givenwsdl.periodictableSoap ();
String retVal = proxyClass.GetAtoms();
String GetAtomicNumber = proxyClass.GetAtomicNumber('Nitrogen');
System.debug('retVal'+retVal);
System.debug('GetAtomicNumber'+GetAtomicNumber);
conversionclass parser=new conversionclass(retVal);
for(integer i=0;i<(retVal.length());i++)
{
String sName=getNodeValue(parser,'ElementName');
System.debug('test'+sName);
}
//To get Node value based on tag name from parser
public String getNodeValue(conversionclass parser1,String tagName)
{
if(parser!=null && tagname!=null)
{
conversionclass.Element element=parser.getElementByTagName(tagName);
if(element!=null)
return element.nodeValue;
}
return '';
}
//To get Node value based on tag name from Element
public String getNodeValue(conversionclass.Element parser1,String tagName)
{
if(parser!=null && tagname!=null)
{
conversionclass.Element element=parser.getElementByTagName(tagName);
if(element!=null)
return element.nodeValue;
}
return '';
}
Problem: How to get all atomic number in the single list, So that i can use it in Vf page to display it using <apex:data-list> or <apex:repeat>
Thanks in advance.