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Ñ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
ÏÈÉý¼¶ieµ½5.5°æÒÔÉÏ
1 ÏÂÔØÖÐÎÄ°æIE6:http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/ie6setup.exe
2 ÏÂÔØmdac°²×° Ö±½ÓÏÂÔØ2.8ÖÐÎÄ°æ:http://download.microsoft.com/download/8/b/6/8b6198c0-fe96-4811-9d81-d5c76dd5fea8/MDAC_TYP.EXE
3 È»ºóÏÂÔØ.NET Framework 1.1°æ¿ÉÔÙ· ......
ΪÁËÍü¼Ç:
1,System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32);:void
//´ÓIISÀ´µÄÇëÇó
2,System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest) : Void
//ÔÚÕâÒ»²½´´½¨Ò»¸öHttpContext¶ÔÏó
3, System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext) : IHttpHandler
// ......
//Ò»£ºÓÃ×Ô¼ºµÄ·þÎñÆ÷×÷ΪÓʼþ·þÎñÆ÷ʱ£º
//Èç³öÏÖ£ºÓÊÏä²»¿ÉÓᣠ·þÎñÆ÷ÏìӦΪ: 5.7.1 Unable to relay for ***@gmail.com
//½â¾ö°ì·¨ÈçÏ£ºÔÚIISÖУ¬ÓÒ»÷“ĬÈÏSMTPÐéÄâ·þÎñÆ÷”£¬Ñ¡Ôñ“ÊôÐÔ”£¬Çл»µ½“·ÃÎʔҳ£¬µã»÷“Öм̔°´Å¥£¬ÔÚµ¯³ö¿òÖÐÑ¡Ôñ“½öÒÔÏÂÁбí³ýÍâ&rdq ......
ÏîÄ¿ÖÐÓÐһЩ±¨±í£¬±¾ÉíËٶȾͲ»Ì«¿ì£¬Óöµ½Êý¾ÝÁ¿´óµÄÇé¿ö£¬¸üÊÇÈÃÈË×¥¿ñ£¬Óû§Ò²Ìá³öÁ˱¨±íËÙ¶ÈÂýµÄÎÊÌ⣬ÓÚÊÇÏë×ÅÈçºÎʵÏÖ±¨±íµÄÊý¾ÝÒÀÀµ»º´æ£¬¼´½«±¨±íÊý¾Ý»º´æ£¬µ±Êý¾Ý·¢Éú¸Ä±äʱ£¬ÔÙÖØлñÈ¡Êý¾Ý¡£
×î¼òµ¥µÄ·½·¨£¬ÊÇÔÚÏÔʾ±¨±íµÄaspxÒ³ÃæµÚÒ»ÐмÓÉÏÐÎÈç<%@ OutputCache Duration="600" VaryByParam="some_par ......