WCF不返回完整的数据字符串

时间:2014-07-21 05:55:49

标签: c# android asp.net json wcf

我正在构建一个使用kso​​ap2来请求将数据发送回移动应用程序的Android应用程序。我使用Windows通信基础作为我的服务。但是,我没有使用此服务从数据库接收完整的JSON数据。这是我在WCF中的配置设置

 <bindings>
  <basicHttpBinding>
    <binding name="basicHttp" maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000" maxBufferSize="20000000" sendTimeout="01:00:00">
      <readerQuotas
        maxArrayLength="20000000"
        maxBytesPerRead="20000000"
        maxDepth="32"
        maxNameTableCharCount="20000000"
        maxStringContentLength="20000000"
        />
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://localhost:1985/wcfservice/Service1.svc" 
            binding="basicHttpBinding" 
            bindingConfiguration="basicHttp" 
            contract="MyWCFService.IService1" 
            name="basicHttp"/>
</client>
<services>
  <service name="MyWCFService.Service1" behaviorConfiguration="metadataBehavior">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttp" name="basicHttp" contract="MyWCFService.IService1"/>
    <endpoint address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="metadataBehavior">
      <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>

我收到的消息不是完整的JSON数据字符串。它实际上以三个尾随时期结束,如此

"ParentGroup": 80
"ID": 25
"Item...

我有一个几乎相同的ASP.NET Web服务,它也以相同的方式从数据库中提取数据,并且我能够在ASP.NET Web服务中获取完整的JSON数据字符串。但不是WCF。我做错了什么......

0 个答案:

没有答案