C# VS2019创建和发布webservice服务端

原文地址::https://www.cnblogs.com/blossomwei/p/13528778.html

相关文章

1、vs2019创建WebService服务----https://blog.csdn.net/Deokoo/article/details/99617735

2、图解VS 2019创建的Web应用程序的生成及发布----https://jingyan.baidu.com/article/08b6a5911fb42d54a909227c.html

3、关于Web Api发布错误:未将对象引用到实例的解决办法----https://blog.csdn.net/weixin_43399489/article/details/104917710

4、asp.net发布网站的时候出现, "发布遇到错误,未将对象引用设置到对象的实例。"----https://bbs.csdn.net/topics/393598263?list=76855539

5、IIS配置----https://www.cnblogs.com/cjgu/p/5515094.html

6、IIS怎样安装与配置----https://jingyan.baidu.com/article/6079ad0eb37aac28fe86db6a.html

7、virtualbox win7 iis 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序----https://blog.csdn.net/yelin042/article/details/72895994

8、由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射----https://blog.csdn.net/dyw_666666/article/details/83317394

9、Web 服务器被配置为不列出此目录的内容----https://www.cnblogs.com/Jacklovely/p/5789237.html

10、IIS配置之Web服务器被配置为不列出此目录的内容----https://blog.csdn.net/upcdxlq/article/details/78449016

11、# vs2017启动网站调试提示 HTTP 错误 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容。 解决方法(超级详细)!!!----https://blog.csdn.net/weixin_43817994/article/details/90145227

 

 

 

 

//===================本人备注==================================

1>VS2019要安装ASP.NET组件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以为您提供关于 C# WebService 服务端的相关信息。C# WebService 服务端是一种基于 SOAP 协议的 Web 服务,它可以通过 HTTP 或 HTTPS 协议进行通信,实现跨平台的数据传输。下面是一个简单的 C# WebService 服务端的实现示例: 1. 创建一个 C# 类,并在类上添加 [WebService] 和 [WebServiceBinding] 属性,示例代码如下: ``` using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class MyWebService : System.Web.Services.WebService { // web service methods here } ``` 2. 在类中添加一个或多个 Web 方法,并使用 [WebMethod] 属性标识它们。示例代码如下: ``` [WebMethod] public string HelloWorld(string name) { return "Hello, " + name + "!"; } ``` 3. 在 Web 服务描述语言 (WSDL) 文件中定义 Web 服务的接口和方法。可以使用 Visual Studio 自带的 WSDL 生成工具或手动创建。示例代码如下: ``` <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/" targetNamespace="http://tempuri.org/"> <wsdl:message name="HelloWorldSoapIn"> <wsdl:part name="name" type="xsd:string"/> </wsdl:message> <wsdl:message name="HelloWorldSoapOut"> <wsdl:part name="return" type="xsd:string"/> </wsdl:message> <wsdl:portType name="MyWebServiceSoap"> <wsdl:operation name="HelloWorld"> <wsdl:input message="tns:HelloWorldSoapIn"/> <wsdl:output message="tns:HelloWorldSoapOut"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="MyWebServiceSoap" type="tns:MyWebServiceSoap"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="HelloWorld"> <soap:operation soapAction="http://tempuri.org/HelloWorld"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="MyWebService"> <wsdl:port name="MyWebServiceSoap" binding="tns:MyWebServiceSoap"> <soap:address location="http://localhost/MyWebService.asmx"/> </wsdl:port> </wsdl:service> </wsdl:definitions> ``` 4. 将该类部署到 IIS 或自承载的 ASP.NET 运行时中。在浏览器中访问 Web 服务的 URL(如 http://localhost/MyWebService.asmx),即可看到 Web 服务的描述信息和测试界面。 希望这些信息能够对您有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值