asp.net原理:asp.net中webservice请求发送原理和过程的初步分析来源: 发布时间:星期六, 2009年3月28日 浏览:0次 评论:0
需求:作为服务方 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 于是自己花了点时间对asp.net ![]() ![]() ![]() 解决方案: 在接口项目中编写 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 1.ip可以通过HttpContext.Current.Request.UserHostAddress得到 2. ![]() 以下是测试 ![]() 先把结论给出: asp.net ![]() ![]() ![]() ![]() ![]() 客户端 ![]() ![]() ![]() ws.Service1 s = ![]() ![]() s.HelloWorld ![]() s.MyTestMethod("sssssssssssssttttt"); 1.在ws.Service1 s = ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 2.只有在运行这行时:s.HelloWorld ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 运行第3行s.MyTestMethod("sssssssssssssttttt");时也是这样 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 测试代码: Code //客户端 ![]() Write("Client端构建对象开始"); ws.Service1 s = ![]() ![]() Write("Client端构建对象完毕"); Write("Client端开始 ![]() s.HelloWorld ![]() Write("Client端 ![]() Write("Client端开始 ![]() s.MyTestMethod("sssssssssssssttttt"); Write("Client端 ![]() Code Write("进入服务器端基类构造思路方法"); ![]() ![]() ![]() ![]() fi.Create ![]() HttpRequest req = HttpContext.Current.Request; ![]() stream.Position = 0; ![]() ![]() ![]() StringBuilder sbRequest = ![]() ![]() String line; // Read and display lines from the file until the end of // the file is reached. while ((line = sr.ReadLine ![]() { sbRequest.Append(line + "\n"); } Write(sbRequest. ![]() ![]() Write("离开 服务器端基类构造思路方法"); 0
相关文章读者评论发表评论 |
|