標籤:style http color io os 使用 ar java for
問題背景
最近使用C#編寫了一個WebService,希望通過Java進行調用。使用Visual Studio 2013調試WebService時,可以在瀏覽器中通過localhost地址訪問WSDL檔案。
訪問方式如:http://localhost:2256/DataProvider.asmx?WSDL。
但是,當使用http://127.0.0.1:2256/DataProvider.asmx?WSDL或者使用http://[本機IP]:2256/DataProvider.asmx?WSDL時,顯示Bad Request錯誤。
現在希望其他機器訪問原生WSDL檔案,所以要求WebService可以使用IP地址訪問。
開發環境:
1)Windows 7
2)Visual Studio 2013
配置方法
1)找到<我的文件>/IIS Express檔案夾,開啟applicationhost.config。
2)在設定檔中找到<sites></sites>標籤。
3)<sites>標籤內包含許多<site>標籤,找到WebService所在的<site>標籤,如 <site name="DataProvider" id="2">。
4)在<site>標籤內找到<bindings>標籤,在<bindings>找到<binding>標籤的bindingInformation屬性,如bindingInformation="*:2256:localhost"。
5)修改localhost為*。有關bindingInformation的詳細資料參考這裡。
6)使用管理員權限重新啟動Visual Studio 2013。
7)偵錯工具。
8)結束。
備忘
bindingInformation設定方法:
1)如果希望對所有IP綁定80連接埠,並且不指定host名稱,則設定為“*:80:”。
2)如果希望對所有IP綁定80連接埠,並且指定host名稱為microsoft.com,則設定為“*:80:microsoft.com”。
2)如果希望對固定IP(192.168.1.150)綁定8080連接埠,則設定為“192.168.1.150:8080:”。
配置IIS Express以便通過IP地址訪問調試的網站