我有WCF RESTful服务和Android客户端。WCF REST服务400错误请求
服务器回复400,当我做更大的请求。似乎我在here或其他数百万个帖子中遇到了65000限制问题,如 。
但是,我似乎无法修复它。这里是我的web.config的样子
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="true" />
</diagnostics>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="myEndpoint" helpEnabled="true" automaticFormatSelectionEnabled="true" maxReceivedMessageSize="1000000" />
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
这里是服务功能的代码示例:
[WebInvoke(UriTemplate = "/trips/{TripId}/inspection", Method = "POST")]
[Description("Used on mobile devices to submit inspections to server")]
public void PostTripInspection(string tripId, Inspection inspection)
{
return;
}
这里是它承载WCF(Global.asax.cs中)我的Web项目
内码private static void RegisterRoutes()
{
// Setup URL's for each customer
using (var cmc = new CoreModelContext())
{
foreach (var account in cmc.Accounts.Where(aa => aa.IsActive).ToList())
{
RouteTable.Routes.Add(
new ServiceRoute(
account.AccountId + "/mobile", new WebServiceHostFactory(), typeof(MobileService)));
}
}
}
从我的理解Java HttpClient没有强加任何限制,所以它在WCF端。任何关于如何解决这个问题的指针或如何拦截WCF中的消息?编辑2: 这是跟踪显示。当我modigy standardEndpoint它并不能帮助......
这似乎是什么,对吗?对我有意义,但不起作用:(看到更新的主要帖子。我跑了跟踪和YES,这个属性似乎是问题,我想知道我需要修改什么绑定.. – katit
它应该工作,但如果它不' t,你可以尝试我添加到答案的更新解决方案 – carlosfigueira
我会将你的帖子标记为答案,因为你指示我回到我应该看的地方猜猜什么?!在删除“name =”“”后开始工作,来自终端Microsoft服务配置编辑器抱怨它,但代码不会注册这个配置任何名称,标签必须出... – katit