增加传递给请求的呼叫的超时值,或者增加Binding.Sharepoint WCF

时间:2019-02-11 14:03:14

标签: wcf sharepoint

Web服务已运行2年以上,现在无法正常工作 这是银行的网站,所以我无法访问服务器。我开发并通过邮件发送代码

GetCurrencyDataFromService()

 #region Set up security binding and service endpoint
            BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
            binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
            binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
            EndpointAddress endpoint = new EndpointAddress(GetValue("ServiceUrl"));//"https://webtest.blabla.com.tr/WebCreditWebServices");
            #endregion


            HEADER header = new HEADER();
            header.SESSION_ID = GetSessionID(binding, endpoint, clientSessionId);


            WebCreditWebServices_PortTypeClient client = new WebCreditWebServices_PortTypeClient(binding, endpoint);

            string CORE_TRX_ID_RESERVED = "";
            string RETURN_CODE = "";
            string RETURN_DESC = "";

            //  System.Console.WriteLine("result");
            return client.WEBEXT_ADCBI_FOREIGN_EXCHANGE_VALID_EXCHANGE_RATE(header, clientSessionId, Guid.NewGuid().ToString(), out CORE_TRX_ID_RESERVED, out RETURN_CODE, out RETURN_DESC);

appconfig

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="WebCreditWebServices_PortBinding">
          <security mode="Transport" />
        </binding>
        <binding name="WebCreditWebServices_PortBinding1" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="https://webtest.blabla.com.tr/WebCreditWebServices"
        binding="basicHttpBinding" bindingConfiguration="WebCreditWebServices_PortBinding"
        contract="WebCreditWebServices.WebCreditWebServices_PortType"
        name="WebCreditWebServices_Port" />
    </client>
  </system.serviceModel>

这是错误

  The request channel timed out while waiting for a reply after 00:00:59.9843762. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. Stack Trace: 
Server stack trace: 
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at blabla.Service.WebCreditWebServices.WebCreditWebServices_PortType.WEBEXT_ADCBI_FOREIGN_EXCHANGE_VALID_EXCHANGE_RATE(WEBEXT_ADCBI_FOREIGN_EXCHANGE_VALID_EXCHANGE_RATERequest request)
   at Service.WebCreditWebServices.WebCreditWebServices_PortTypeClient.Web.Service.WebCreditWebServices.WebCreditWebServices_PortType.WEBEXT_ADCBI_FOREIGN_EXCHANGE_VALID_EXCHANGE_RATE(WEBEXT_ADCBI_FOREIGN_EXCHANGE_VALID_EXCHANGE_RATERequest request)
   at Service.WebCreditWebServices.WebCreditWebServices_PortTypeClient.WEBEXT_ADCBI_FOREIGN_EXCHANGE_VALID_EXCHANGE_RATE(HEADER HEADER, String CLIENT_SESSION_ID, String CLIENT_TRX_ID_RESERVED, String& CORE_TRX_ID_RESERVED, String& RETURN_CODE, String& RETURN_DESC)
   at Matriks.Console.Program.GetCurrencyDataFromService()

0 个答案:

没有答案