我有一个简单的WCF服务,需要处理大数据流,所以我有很多配置值突然超过默认值.我最近一直在将所有代码转移到一个新的重组解决方案中,而我刚刚转移了这项服务.但是,当我尝试生成客户端代理(在VS2008中使用WCFTestClient.exe或"添加服务引用"时,客户端代理配置中的值与我为服务设置的值不匹配.
这是服务器配置 - 注意maxBufferSize,maxReceivedMessageSize,maxStringContentLength和MaxArrayLength的增加值
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="default" maxBufferSize="5000000" maxReceivedMessageSize="5000000">
<readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" />
<!-- turn this setting on to require SSL/https -->
<!-- <security mode="Transport" /> -->
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Consent.Service.SubjectConsentServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Consent.Service.SubjectConsentServiceBehavior"
name="Consent.Service.SubjectConsentService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="default"
contract="Consent.Service.ISubjectConsentService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
这是VS2008使用"添加服务参考"生成的代理
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISubjectConsentService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" …Run Code Online (Sandbox Code Playgroud) 我有一个包含多个输入的页面 - 我正在使用Ajax.BeginForm为每组输入构建一个表单.
<% using (Ajax.BeginForm(new AjaxOptions() { InsertionMode = InsertionMode.InsertAfter, HttpMethod = "POST" }))
{ %>
<input class="smallInput" type="text" name="duration"/>
<input type="submit" value="Add" />
<% } %>
Run Code Online (Sandbox Code Playgroud)
控制器看起来像这样
[AcceptVerbs("POST")]
public ActionResult AddExercise(FormCollection form)
{
// some save logic...
return Content(string.Empty);
}
Run Code Online (Sandbox Code Playgroud)
这样做 - 数据提交给我的控制器并保存.
但是,每次发生这种情况时,我的页面都会被空白页面替换.如果我从我的Action中显式返回一个View,则会显示该视图.但是我希望它能够提交表单,将我现有的页面保留原样.
我想从另一个字符串中删除一个字符串。
我首先使用 contains 方法,然后当我发现一个字符串包含另一个字符串时遇到麻烦,我尝试了这个:
someString -= anotherString
Run Code Online (Sandbox Code Playgroud)
但这不起作用,并尝试使用替换功能来做到这一点。但这也不起作用。有人能帮我吗?