ASP.NET Web ServiceÐÒéÏà¹Ø
=================================================================================
How to enable an ASP.NET WebService to listen to HTTP POST calls
=================================================================================
Imagine you developed an ASP.NET WebService, but the client that needs to use it wants to call it using HTTP POST instead of SOAP.
As default, when accessed from the localhost, all webservices listen both to SOAP and HTTP POST calls, but if accessed from another host they
listen only to SOAP.
My friend Google found a page on the MSDN site that explains how to change the protocols accepted by the ASP.NET runtime to listen to web
services calls.
As all configuration settings it can be changed both at machine level (machine.config) and per single application inside the web.config.
The configuration section is named <webServices> and is inside the <system.web> section.
The default configuration (the one that is inside a newly installed machine.config) is the following:
<system.web>
...
<webServices>
<protocols>
<add name="HttpSoap"/>
<!-- <add name="HttpPost"/> -->
<!-- <add name="HttpGet"/> -->
<add name="Documentation"/>
<add name="HttpPostLocalhost"/>
</protocols>
</webServices>
...
</system.web
Option names are quite self explaining. So, in order to enable allow HTTP POST call
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
×î½üÏë°Ñ×öµÄASP.NETÍøÕ¾ÅäÖõ½IIS£¬ÊµÏÖÔÚ¾ÖÓòÍøÖзÃÎÊ¡£ÔÚÍøÕ¾ÉÏÕÒÁËЩ×ÊÁÏ£¬×Ô¼ºÑо¿ÁËÏ£¬ÏÖ°ÑһЩ¾ßÌå²½Öè¼°ÎÊÌâ·ÖÏí³öÀ´£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
Ò»¡¢ÅäÖÃIIS
1¡¢"³ÌÐò"->"ÉèÖÃ"->"¿ØÖÆÃæ°å"->"¹ÜÀí¹¤¾ß"->Ñ¡Ôñ"Internet Ð ......
ÒÔÏÂÒýÓÃ×Ô MSDN Magazine:
²»Âۺûµ£¬UpdatePanel ¿Ø¼þ¶¼ÊÇ ASP.NET AJAX ÉçÇøËùϲ°®µÄ¡£ÎÒ˵“ºÃ”£¬ÊÇÒòΪ UpdatePanel ʹ²¿·ÖÒ³Ãæ³ÊÏÖ±äµÃÏ൱¼òµ¥£¬¶ø˵“»µ”£¬ÊÇÒòΪËüµÄ¼ò±ãºÍÒ×ÓÃÐÔÊÇÒÔЧÂʺÍÁîÈËÌäЦ½Ô·ÇµÄ´ø¿íΪ´ú¼ÛµÄ¡£
UpdatePanel ¿ÉÒÔΪһ°ãµÄÍøÒ³´øÀ´ AJAX ÉñÆæµÄºÃ´¦£¬µ«ÊÇËü²»ÄÜÌá ......
protected void btncancel_Click(object sender, EventArgs e)
{
Page.RegisterStartupScript("", "<mce:script type="text/javascript"><!--
window.close()
// --></mce:script>");
}
......
¿´ÁËasp.net µÄ»Øµ÷¼¼Êõºó²»ÊǺÜÀí½â¡£»¹ÊÇ°ÑдµÄ¶«Î÷ÌùÏ£¬×Ô¼ºÒÔºóѧϰʱºò¶à¿´¿´¡£Ç°Ì¨index.aspxÒ³<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="_Default" %>
<%@ Import Namespace = "System.Text" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transit ......