日期:2014-05-17 浏览次数:20442 次
namespace WcfService
{
public class Service1 : IService1
{
public int GetData(string value)
{
value = value == null ? "" : value;
return value.Length;
}
}
}
namespace WcfService
{
[ServiceContract]
public interface IService1
{
[OperationContract]
int GetData(string value);
}
}
Service1Client wcf_client = new Service1Client();
string itemstr = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
string teststr = "";
for (int i = 0; i < 100; i++)
{
teststr += itemstr;
}
int b = teststr.Length;
int a = wcf_client.GetData(teststr);
wcf_client.Close();
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
<behavior name="A">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647