开发者

Time out webservice client

First sorry for my english.

I am having issues with a web service, this is provided by a client and sadly I cant change anything and they are refusing anyways, now they consume this webservice with java but in my work thats not posible.

With the following code I can retrive a response up to 8k but anything beyond that get me a "timeoutexception", I have try to use a stream a string to save the response. I am fairly new to webservices so I maybe missing something.

public String obtenerData(int idCuestionario, string fechaInicio, string fechaFinal, string path)
{
  try
  {

    String request = "<request><token><![CDATA[" + Globals.token + "]]></token>" +
              "<idCuest><![CDATA[" + idCuestionario + "]]></idCuest>" +
              "<fechaInit><![CDATA[" + fechaInicio + "]]></fechaInit>" +
              "<fechaFin><![CDATA[" + fechaFinal + "]]></fechaFin>" +
              "</request>";

    response = (string)(wsRep.generaReporte(request));

    try
    {
      doc.LoadXml(response);
      if (String.IsNullOrEmpty(path))
      {
        doc.Save(idCuestionario + "_" + ".xml");
      }
      else
      {
        doc.Save(path + "\\" + idCuestionario + "_" + ".xml");
      }

    }
    catch (Exception ex)
    {
      MessageBox.Show(ex.Message);
    }
    Globals.token = Globals.tokenK.obtenerToken(response);
  }

}

And this is the web.config

<binding name="ReportesWebServiceSoapBinding" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="Strong开发者_JAVA技巧Wildcard"
      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
        <message clientCredentialType="UserName" algorithmSuite="Default" />
      </security>
    </binding>


Have you tried increasing the timeout?

e.g.

wsRep.Timeout = 20000; // 20 second
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜