예제 #1
0
 public void SimpleWSCallTest()
 {
     using (Server s = new Server(new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 }), "/", PhysicalPath, _port)) {
         s.Start();
         using (WebService ws = new WebService()) {
             ws.Url = string.Format("http://localhost:{0}/WebService.asmx", _port);
             string response = ws.HelloWorld();
             Assert.AreEqual("Hello World", response);
         }
         s.Stop();
     }
 }
예제 #2
0
 public void PrimitiveTypeWSCallTest()
 {
     using (Server s = new Server(new System.Net.IPAddress(new byte[] { 127, 0, 0, 1 }), "/", PhysicalPath, _port)) {
         s.Start();
         using (WebService ws = new WebService()) {
             ws.Url = string.Format("http://localhost:{0}/WebService.asmx", _port);
             int result = ws.DoAdd(4, 7);
             Assert.AreEqual(11, result);
         }
         s.Stop();
     }
 }