calling a WCF server methods dynamically by a WCF Test Client RRS feed

  • Question

  • Hi,

                I am developing a wcf Test client which test the web services dynamically. As part of this I Am facing a problem with response from the server while calling a method dynamically I am getting Page not found error.


    My code is


                 string oRequest = @"<s:Envelope xmlns:s="""">


        <Action s:mustUnderstand=""1"" xmlns=""""></Action>



        <Add xmlns="""">






                    //Builds the connection to the WebService.

                    HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://localhost:8733/Design_Time_Addresses/Mathematics/IICalc/?wsdl");

                    req.Headers.Add("SOAPAction", @"");

                    req.ContentType = "text/xml; charset=\"utf-8\"";

                    req.Accept = "text/xml";

                    req.Method = "POST";

                    //Passes the SoapRequest String to the WebService

                    using (Stream stm = req.GetRequestStream())


                        using (StreamWriter stmw = new StreamWriter(stm))





                    //Gets the response

                    //WebResponse response = req.GetResponse();

       HttpWebResponse response = (HttpWebResponse)req.GetResponse();  // getting error at //this point

                    //Writes the Response

                    Stream responseStream = response.GetResponseStream();


    Please let me know where I am going wrong.

    Is there any other way to call the server methods other than http, Channel factory ???

    If there are any other optimal way to achieve the same  please share with me.

    Thank you.



    • Edited by Manikanta3 Wednesday, June 12, 2013 1:13 PM
    Wednesday, June 12, 2013 11:59 AM


All replies