none
C# and soap UI mock Service RRS feed

  • Question

  • Hi,

    In my Dev environment, I use Soap UI mock service for developing my application. my requirement in one of my test case is I have to stop my soapUI mock service through C# code or method. I am not able to do it.

    Did any one try it? can you let me know the process or share the code snippet if anyone does it?

    Thanks,

    Sujith.

    Wednesday, January 13, 2016 10:55 AM

Answers

  • Hi sujith,

    According to this case, I am not sure how to mock a service by Soap UI. I guess you entry

    a service WSDL document via URL. Then we can test the service method via Soap UI. If so,

    please make sure what way that hosted the service. Is IIS or Self Host?

    If you host your service on IIS, and you want to stop the service, you need to stop the

    service by IIS. If you host your service on application, you just need to call the close()

    method to close the service. Like below:

     static void Main(string[] args)
            {
                ServiceHost host = new ServiceHost(typeof(Class1), new Uri(("http://localhost:8000")));
                ServiceEndpoint edp = host.AddServiceEndpoint(typeof(IService),new BasicHttpBinding(),"");
                ServiceDebugBehavior stp = host.Description.Behaviors.Find<ServiceDebugBehavior>();
                stp.HttpsHelpPageEnabled=false;
                host.Open();
                Console.WriteLine("service is up and running ");
                Console.WriteLine("please press any key to stop");
                Console.ReadLine();
                host.Close();
            }
               

    If I miss understanding your question, please let me know.

    Best Regards,

    Wanjun Dong


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Thursday, January 14, 2016 2:59 AM
    Moderator