internal XmlRpcMethodResponse(string responseText)
{
try
{
// analyze the response text to determine the content of the response
XmlDocument document = new XmlDocument();
if (responseText != null)
{
responseText = responseText.TrimStart(' ', '\t', '\r', '\n');
}
document.LoadXml(responseText);
IXmlNode responseValue = document.SelectSingleNode("/methodResponse/params/param/value");
if (responseValue != null)
{
_response = responseValue;
}
else
{
// fault occurred
_faultOccurred = true;
IXmlNode errorCode = document.SelectSingleNode("/methodResponse/fault/value/struct/member[name='faultCode']/value");
_faultCode = errorCode.InnerText;
IXmlNode errorString = document.SelectSingleNode("/methodResponse/fault/value/struct/member[name='faultString']/value");
_faultString = errorString.InnerText;
}
}
catch (Exception ex)
{
throw new XmlRpcClientInvalidResponseException(responseText, ex);
}
}