WebService创建、发布及在IIS上部署

WebService创建、发布及在IIS上部署

https://blog.csdn.net/u011534341/article/details/44925473

 

让WebService支持HTTPGET

https://blog.csdn.net/ss_tt_ll/article/details/81300119

在WebService工程的Web.config文件中<system.web>节的最后增加以下内容

<webServices>
            <protocols>
                <add name="HttpSoap1.2"/>
                <add name="HttpSoap"/>
                <add name="HttpPost"/>
                <add name="HttpGet"/>
                <add name="HttpPostLocalhost"/>
                <add name="Documentation"/>
            </protocols>
        </webServices>

可以参考/Microsoft.NET/Framework/{version}/CONFIG/machine.config里面的<webServices>一节的内容

由于HttpGet这里被屏蔽掉了,因此在web.config里面要放开才行,

至于HttpPost也是屏蔽状态,估计默认在WebService里面是允许的吧。

        <webServices>
            <protocols>
                <add name="HttpSoap1.2"/>
                <add name="HttpSoap"/>
                <!-- <add name="HttpPost"/> -->
                <!-- <add name="HttpGet"/> -->
                <add name="HttpPostLocalhost"/>
                <add name="Documentation"/>
            </protocols>
            <soapExtensionTypes>
            </soapExtensionTypes>
            <soapExtensionReflectorTypes>
            </soapExtensionReflectorTypes>
            <soapExtensionImporterTypes>
            </soapExtensionImporterTypes>
            <wsdlHelpGenerator href="DefaultWsdlHelpGenerator.aspx"/>
            <serviceDescriptionFormatExtensionTypes>
            </serviceDescriptionFormatExtensionTypes>
        </webServices>
 

Webservice返回json数据格式

https://www.cnblogs.com/xinweichen/p/4552187.html

改变数据的返回方式,用 Context.Response.Write代替return 语句

<span >   

 [WebMethod]  

   public void GetQrCodeList(String qrCode)  

  {  

      Context.Response.Charset = "GB2312"; //设置字符集类型  

        Context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");  

       Context.Response.Write(PriGetQrCodeList(qrCode));  

       Context.Response.End();  

    }</span>  

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值