operation has timed out error on calling simple external asp.net web service

Mory Zad asked on May 18, 2014 04:17

in version 7

I have created a simple web service app hosted on local IIS. i have tested the service with another asp.net 4 web site hosted on IIS and everything works normally.

when i try to use service in kentico i get this error :

    Server Error in '/' Application.
    The operation has timed out
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.WebException: The operation has timed out

    Source Error: 

    Line 49:         
    Line 50:         public bool S1(string input) {
    Line 51:             return base.Channel.S1(input);
    Line 52:         }
    Line 53:     }


[WebException: The operation has timed out]
   System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) +1176
   System.Net.HttpWebRequest.GetRequestStream() +23
   System.ServiceModel.Channels.WebRequestHttpOutput.GetOutputStream() +190

[TimeoutException: The HTTP request to 'http://localhost:8080/test.asmx' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.]
   System.ServiceModel.Channels.WebRequestHttpOutput.GetOutputStream() +17126339
   System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) +207
   System.ServiceModel.Channels.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) +657
   System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) +348

[TimeoutException: The request channel timed out attempting to send after 00:01:00. 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.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14799942
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
   ZZZ.testSoap.S1(String input) +0
   ZZZ.testSoapClient.S1(String input) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\b5b2ffc9\1369a3df\App_WebReferences.dfs7tgnz.1.cs:51
   Custom_WebUserControl1.Page_Load(Object sender, EventArgs e) in d:\k3\zzz\WebUserControl1.ascx.cs:11

the user control is very simple control :

public partial class Custom_WebUserControl1 : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var soapClient = new ZZZ.testSoapClient("testSoap");
        bool x = soapClient.S1("test");
        Label1.Text = x.ToString();
    }
}

content of App_WebReferences folder :

ZZZ\configuration.svcinfo
ZZZ\configuration91.svcinfo
ZZZ\Reference.svcmap
ZZZ\test.disco
ZZZ\test.wsdl

I have added web service reference to kentico with visual studio 2013.

I'm sure the problem is not duration of SendTimeout . the service is simple service with 1 second response.

it seems kentico dosent send request to service at all.

Thanks

Recent Answers


Mory Zad answered on May 18, 2014 04:22

i forgot to include web.config part, here its is

   <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="testSoap" sendTimeout="00:01:00" />
      </basicHttpBinding>
      <customBinding>
        <binding name="testSoap12">
          <textMessageEncoding messageVersion="Soap12"/>
          <httpTransport/>
        </binding>
      </customBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8080/test.asmx" binding="basicHttpBinding" bindingConfiguration="testSoap" contract="ZZZ.testSoap" name="testSoap"/>
      <endpoint address="http://localhost:8080/test.asmx" binding="customBinding" bindingConfiguration="testSoap12" contract="ZZZ.testSoap" name="testSoap12"/>
    </client>
  </system.serviceModel>
0 votesVote for this answer Mark as a Correct answer

Martin Hejtmanek answered on July 23, 2014 09:18

You don't seem to use any Kentico API for that, so I believe this is either configuration problem of network problem. Please consider following:

  • Have you tried to access the service from the browser on this URL? Does it respond / work? If not, focus on the target instance or the port availability

  • Is 8080 the default port in your IIS? If not, and the instance with the service is a virtual instance which runs from Visual Studio, make sure that it runs while you are testing your code

  • If the target instance is a Kentico instance, you may need to add the service URL to the excluded URLs in settings so that it is not overtaken by Kentico URL rewriting

  • If none of these helps, please run Fiddler to see what is happening at the network level and provide more information

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.