views:

19

answers:

0

Hi,

with the ref of page:
http://stackoverflow.com/questions/2469594/how-to-access-a-php-web-service-from-asp-net/2825735#2825735

I got following code; I cudnot find "requestXmlString" in whole code, where to declare and what is in this variable? Its urgent please.

private string MakeWebServiceCall(string methodName, string requestXmlString) { WebRequest webRequest = WebRequest.Create("https://subreg.forpsi.com/robot2/subreg_command.php");

        HttpWebRequest httpRequest = (HttpWebRequest)webRequest; 
        httpRequest.Method = "POST"; 
        httpRequest.ContentType = "text/xml"; 
        httpRequest.Headers.Add("SOAPAction: https://subreg.forpsi.com/robot2/subreg_command.php/" + methodName); 
        Stream requestStream = httpRequest.GetRequestStream(); 

        //Create Stream and Complete Request 
        StreamWriter streamWriter = new StreamWriter(requestStream); 
        streamWriter.Write(String.Format(this.GetSoapString(), requestXmlString)); 
        streamWriter.Close(); 

        //Get the Response 
        WebResponse webResponse = httpRequest.GetResponse(); 
        Stream responseStream = webResponse.GetResponseStream(); 
        StreamReader streamReader = new StreamReader(responseStream); 

        //Read the response into an xml document 
        System.Xml.XmlDocument soapResonseXMLDocument = new System.Xml.XmlDocument(); 
        soapResonseXMLDocument.LoadXml(streamReader.ReadToEnd()); 

        //return only the xml representing the response details (inner request) 
        return soapResonseXMLDocument.GetElementsByTagName(methodName + "Result")[0].InnerXml; 
    }