我有一個WCF REST服務的問題,我無法理解。 問題在於該服務是由IIS託管的。WCF REST服務,IIS和數據庫
在服務我有兩個功能:
[ServiceContract]
public interface IFishMapService
{
[OperationContract]
[WebInvoke(Method = "GET",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
UriTemplate = "/FindAllRecords")]
List<Record> findAllRecords();
[OperationContract]
[WebInvoke(Method = "GET",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
UriTemplate = "/returnHello")]
String returnHello();
}
第二個是一個簡單的測試函數返回一個字符串。 第一個返回一個列表並連接到我的機器上的數據庫通過MS SQL服務器2008年取得
所以......這是怎麼回事,而測試: - 如果我測試的第二功能與像我的IP地址這個:
ipAddress/MyApp/FishMapService.svc/returnHello
一切都好!
,如果我做同樣的與第二功能,但與本地主機:
本地主機:57640/FishMapService.svc/returnHello
一切也行!獲得一個美好而美好的迴應!
如果我測試的第一個本地主機與:
本地主機:57640/FishMapService.svc/FindAllRecords
我看到已經發送了查詢的結果!再次美麗!我看到了我需要的所有信息。
,如果我考一個相同的,但我的IP:
ip地址/ MyApp的/ FishMapService.svc/FindAllRecords
在瀏覽器中 「[]」 得到這個?!
這是怎麼回事?有任何想法嗎?
它是否區分大小寫? – 2013-02-08 18:26:57
對不起,這是我的錯誤。在寫文章時。現在編輯。 – user2004702 2013-02-08 19:00:51
有人有任何想法如何解決這個問題? – user2004702 2013-02-09 10:55:58