使用Windows Service调用WCF的方法 [英] Calling the methods of WCF with Windows Service

查看:154
本文介绍了使用Windows Service调用WCF的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


任何人都可以建议我有关此查询....

当我运行Windows服务时,出现这样的错误,\


"尝试反序列化参数:GetApplicationResult时发生错误.InnerException消息为反序列化TeamsSQWinService.BAServiceReference.AppInfo类型的对象时出错.读取XML数据时已超出最大数组长度配额(16384).此配额可以通过更改在创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxArrayLength属性来增加它.".有关更多详细信息,请参见InnerException."

Hi
Can anybody suggest me regarding this query....

When i run my windows service, i am getting the error like this,\


" an error while trying to deserialize parameter :GetApplicationResult. The InnerException message was ''There was an error deserializing the object of type TeamsSQWinService.BAServiceReference.AppInfo. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.''. Please see InnerException for more details."

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="SqlCon" value="Connectionstring" />
    <add key="OraCon" value="Connectionstring"" />
  </appSettings>
  <system.serviceModel>
    <bindings>
        <customBinding>
            <binding name="CustomBinding_BAService">
                <binaryMessageEncoding />
                <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
            </binding>
        </customBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:1813/BAService.svc" binding="customBinding"

        bindingConfiguration="CustomBinding_BAService" Myservicereference

        name="CustomBinding_BAService" />
    </client>
  </system.serviceModel>
</configuration>

推荐答案

尝试增加maxBufferSize和maxReceivedMessageSize.
如果不起作用,请尝试使用basicHttpBinding而不是自定义绑定.
try increasing maxBufferSize and maxReceivedMessageSize.
If it doesnt work, try using basicHttpBinding instead of custom binding.


这篇关于使用Windows Service调用WCF的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆