我有一个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