public string getString() { if (type == null) { return(null); } if (type == XmlRpc_Wrapper.TypeEnum.TypeString) { return(fuckyou); } else if (type == XmlRpc_Wrapper.TypeEnum.TypeInt) { return(_value.ToString()); } else if (type == XmlRpc_Wrapper.TypeEnum.TypeDouble) { return(_value.ToString()); } return(null); }
public string getString() { if (type == null) { return(null); } if (type == XmlRpc_Wrapper.XmlRpcValue.ValueType.TypeString) { return(jordanString); } else if (type == XmlRpc_Wrapper.XmlRpcValue.ValueType.TypeInt) { return(_value.ToString()); } else if (type == XmlRpc_Wrapper.XmlRpcValue.ValueType.TypeDouble) { return(_value.ToString()); } return(null); }
// Parse the method name and the argument values from the request. private string parseRequest(XmlRpcValue parms, string _request) { bool success = true; string methodName = "unknown"; //XmlRpcValue result = null; using (XmlReader reader = XmlReader.Create(new StringReader(_request))) { XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(reader); // Parse response xml into result //int offset = 0; XmlNodeList xmlMethodNameList = xmldoc.GetElementsByTagName("methodName"); if (xmlMethodNameList.Count > 0) { XmlNode xmlMethodName = xmlMethodNameList[0]; methodName = xmlMethodName.InnerText; } XmlNodeList xmlParameters = xmldoc.GetElementsByTagName("param"); XmlNodeList xmlFault = xmldoc.GetElementsByTagName("fault"); if (xmlParameters.Count == 0) { XmlRpcUtil.error("Error in XmlRpcServer::parseRequest: Invalid request - no methodResponse. Request:\n{0}", _request); return(null); } parms.SetArray(xmlParameters.Count); for (int i = 0; i < xmlParameters.Count; i++) { var value = new XmlRpcValue(); value.fromXml(xmlParameters[i]["value"]); parms.asArray[i] = value; } if (xmlFault.Count > 0 && parms.fromXml(xmlFault[0])) { XmlRpcUtil.log(XmlRpcUtil.XMLRPC_LOG_LEVEL.WARNING, "Read fault on response for request:\n{0}\nFAULT: {1}", _request, parms.ToString()); } } return(methodName); }