⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class1.cs

📁 Visual C++.net编成指南一书的源代码
💻 CS
字号:
using System;

namespace HttpListenerCSharpClient
{
	/// <summary>
	/// Summary description for Class1.
	/// </summary>
	class Class1
	{
		static void Main(string[] args)
		{
			/*	This is just a very simple client showing how to use the HttpListener SoapTransport from a C# application,
				without having to write any custom transport code on the client side
			  
				To regenerate the Web Reference, just start the HttpListenerServer, then launch Add Web Reference wizard and make it
				point to http://localhost:333/disco
				
			
				To generate a native client for HttpListenerServer, use the following URL:
				http://localhost:333/SimpleSoapAppService?wsdl
			
			  
			*/


			try
			{
				localhost.SimpleSoapAppService	srv	=	new localhost.SimpleSoapAppService();

				string	strResult	=	srv.HelloWorld("Test String");

				Console.WriteLine("Mathod invocation result : " + strResult);
			}
			catch(System.Web.Services.Protocols.SoapException e)
			{
				
				Console.WriteLine("SoapException caught: ");
				Console.WriteLine("	Actor:"+ e.Actor);
				Console.WriteLine("	Code:"	+ e.Code);
				Console.WriteLine("	Detail:"+ e.Detail.InnerText);
			}
			catch(System.Exception e)
			{
				Console.WriteLine("Exception caught: " + e.ToString());
			}

		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -