Tuesday, March 27, 2007
.NET 下的 WebService 開發
最近工作上需要開發一個WebService,因為發現在.NET平台上應該很好開發,所以雖然對C#的語言不熟,但是還是決定以C#來開發。利用Visual Studio.NET 2003的範例,果然很快就做出一個WebService。但是使用IE測試時,卻發現在遠端機器測試時,會出現 "The test form is only available for requests from the local machine" 的訊息。覺得很奇怪,於是上Google查,果然發現有高手已解答,也就是在 web.config 中加入以下文字即可:
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</configuration>
Google 啊! 真神啊! Google 真神啊!
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</configuration>
Google 啊! 真神啊! Google 真神啊!