[Mono-aspnet-list] Apache mod_mono web service timeout exception not as expected

Wagark dantespace.ml at gmail.com
Thu Sep 24 09:15:55 EDT 2009


Hello guys,
   anybody can help?

Thanks and regards,
Dante

----------------------------------

Hi,

I have developed a web service that will run on Linux. I have an issue when
the web method called spend more time to run than timeount set in
Web.config.

I added these lines in web.config to manage timeout exception:

<system.web>
<!-- [...] -->
      <httpRuntime executionTimeout="1"
          maxRequestLength="4096"
          useFullyQualifiedRedirectUrl="false"
          minFreeThreads="8"
          minLocalRequestFreeThreads="4"
          appRequestQueueLimit="100" />

      <customErrors mode="Off"/>
<!-- [...] -->
</system.web>

My web service is the following:

[WebMethod]
public string HelloWorld(int timeout)
{
     Thread.Sleep(timeout);   //milliseconds
     return "Hello World";
}

I tested timeout exception from remote machine using a test project from
Visual Studio with the following test:

        // Calling HelloWorld that sleeps 10 seconds but setting mod_mono
timeout just to 1 second.
        [TestMethod]
        public void TestWsUtilitiesHelloWorldTimeoutExceptionOnLinux()
        {
            PrepareDiskSoapClient c = new PrepareDiskSoapClient(
           "PrepareDiskSoap",
"http://[ipMachine]/[ProjectName]/PrepareNewVMDiskImage.asmx");

            c.HelloWorld(10000);
        }

As you can see I used a client/proxy created with WCF to call the web
service.
I also tried to use the client proxy automatically generated by mod_mono
application.

Anyway, in both scenarios an exception not just about the timeout is thrown.
Using mod_mono automatically generated client proxy the exception is the
following:

Test method
Reply.PrivateCloud.Tests.WsUtilitiesTest.TestTimeoutExceptionOnLinuxWithClientProxyGeneratedByLinux
threw exception: System.InvalidOperationException: Client found response
content type of 'text/html; charset=utf-8', but expected 'text/xml'.
The request failed with the error message:
--
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en"><head><title>Error 500</title><style type="text/css">body
{font-family:"Verdana","DejaVu
Sans",sans-serif;font-weight:normal;font-size:
.7em;color:black;background-color: white}
p {font-family:"Verdana","DejaVu
Sans",sans-serif;font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana","DejaVu
Sans",sans-serif;font-weight:bold;color:black;margin-top: -5px}
h1 { font-family:"Verdana","DejaVu
Sans",sans-serif;font-weight:normal;font-size:18pt;color:red }
h2 { font-family:"Verdana","DejaVu
Sans",sans-serif;font-weight:normal;font-size:14pt;color:maroon }
pre,code {font-family:"Lucida Console","DejaVu Sans
Mono",monospace;font-size: 0.9em,white-space: pre-line}
div.bodyText {font-family: "Verdana","DejaVu Sans",sans-serif}
table.sampleCode {width: 100%; background-color: #ffffcc; }
.errorText {color: red; font-weight: bold}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy;
cursor:pointer; }</style></head><body><h1>Server Error in
'/Reply.PrivateCloud.WSUtilities' Application</h1><hr style="color:
silver"/><h2><em>The request timed out.</em></h2>
<p><strong>Description: </strong>HTTP 500. Error processing request.</p>
<p><strong>Stack Trace: </strong></p><table summary="Stack Trace"
class="sampleCode">
<tr><td><pre>System.Web.HttpException: The request timed
out.</pre></td></tr>
</table>
<hr style="color: silver"/><strong>Version information: </strong> Mono
Version: 2.0.50727.42; ASP.NET Version: 2.0.50727.42</body></html>
<!--
[System.Web.HttpException]: The request timed out.

-->
--.

Basically the client wait for a XML answer but receives an HTML answer.
Mod_mono is configured using AutoHosting method.

Could anyone help to solve this issue?

Thank you in advance for your help,
Dante


-- 
View this message in context: http://www.nabble.com/Apache-mod_mono-web-service-timeout-exception-not-as-expected-tp25491479p25567738.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.



More information about the Mono-aspnet-list mailing list