Webservice - Operation has timed out

Martijn Haex picture Martijn Haex · Oct 22, 2012 · Viewed 8.2k times · Source

The project that I'm working on is the following: I've got a Java webservice that encrypts data (Des, 3Des). The data is send from a C# application. With I want to encrypt/decrypt a file of the size 1MB. I'll get an exception.

The file are put in a byte[], in bitformat and send to the Java webservice for encryption/decryption. After the webservice has done that it needs to send the encrypted/decrypted data back.

With small files I've got no problem but the file of the size 1MB or greater the exception is thrown in the C# application, the errors has the following message: WebException was unhandled: The operation has timed out

This error is thrown after approximately: 1min40sec

I've read different posts on StackOverflow but they seem always to work with WebRequest and WebResponse. I am not working with that, the code I use to call my webservice is:

public byte[] TEncode(byte[] input, byte[] key)
{
    return _webservice.TDesEncode(input, key);
}

Has anyone some advice what I can do to fix this problem?

EDIT Tried to increase the session timeout in the app.config file like:

<system.web>
<sessionState timeout="20"></sessionState>
</system.web>

Thanks in advance Martijn

Answer

Lucas B picture Lucas B · Oct 22, 2012

Sounds like you need to increase the timeout. Check out this site for an explaination and possible fix.