1.撰寫 *.asmx
2.編譯 *.dll
3.放置 *.dll 在 bin 目錄下
4.點 工具列 Project/Add References 選取 *.dll
5.編輯 *.aspx 呼叫
6.瀏覽 IE 沒問題
但是......................
我用另外一台機器(機器A),要使用我本機的Web Service
我不知道該使用哪個方法才對,我使用了兩個方法:
方法一:Project / Web References
1.使用 Project / Web References / 輸入我本機*.asmx網址
2.撰寫 *.aspx 呼叫
3.結果在程式呼叫時,就出現未定義的錯誤訊息
方法二:Project / References
1.把我本機編譯好的 *.dll 放置(機器A)的bin目錄下
2.使用 Project / References / .NET 選取(機器A)的 *.dll
3.撰寫 *.aspx 呼叫
4.結果出現以下錯誤訊息
The request failed with HTTP status 404: Not Found.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.Net.WebException: The request failed with HTTP
status 404: Not Found.
Source Error:
Line 36:
Line 37: Dim objAA As AA= New AA
Line 38: lblBB.Text = objAA.getCard("1")
Line 39:
Line 40: End Sub
"Vinny" 來函: