Exemplo n.º 1
0
        public override object ParseResponse(string url, Stream result)
        {
            // Parse xml
            XmlDocument xml = new XmlDocument();

            using (StreamReader reader = new StreamReader(result))
            {
                string text = reader.ReadToEnd();
                try
                {
                    xml.LoadXml(text);
                }
                catch (Exception e)
                {
                    Logger.Instance.Error(this, "Error in SOAP response:\nurl={0}\nresponse={1}", url, text);
                    throw e;
                }
            }

            // Check if it's an error message
            CheckFaultResponse(xml);

            // Select the respone data
            // TODO: do this with proper xmlns
            XmlNode part = xml.SelectSingleNode("//*[local-name()='" + _request.RequestName + "Response']/return");

            // Let the request handle it
            return(_request.ParseResponse(part));
        }
        public override object ParseResponse(Stream result)
        {
            // Parse xml
            XmlDocument xml = new XmlDocument();

            xml.Load(result);

            // Check if it's an error message
            CheckFaultResponse(xml);

            // Select the respone data
            // TODO: do this with proper xmlns
            XmlNode part = xml.SelectSingleNode("//*[local-name()='" + _request.RequestName + "Response']/return");

            // Let the request handle it
            return(_request.ParseResponse(part));
        }