-1

I have created an HttpHandler for uploading multiple files to server. In my project there are 2 web applications: one is a Silverlight Application and the other is a WCF service. My HttpHandler is in the WCF service project. It is working fine when I run the application from the Visual Studio environment. It uploads the file to server and process the file.

When I host the same application in IIS 5.1, I am not getting the HttpResponse back to my application. When I tried to read the response from EndGetResponse(asynchronousResult) it just throws an exception. Even it was working fine when the HttpHandler file was in the Silverlight application. I am not able to debug the HttpHandler when I host the application in IIS.

Here's my code:

private void ReadHttpResponseCallback(IAsyncResult asynchronousResult)
{ 
    try
    {
        HttpWebRequest webRequest = (HttpWebRequest)asynchronousResult.AsyncState;
        HttpWebResponse webResponse = (HttpWebResponse)webRequest.EndGetResponse(asynchronousResult);
        // Here it throws erro and go to Catch block
        StreamReader reader = new StreamReader(webResponse.GetResponseStream());
        // more code here
    }
    catch
    {
    }
}

How can I make this work?

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
Anil Kumar
  • 19
  • 1
  • 2
  • have you tried issuing the request directly from fiddler? – Antony Scott Aug 12 '11 at 15:42
  • It may be down to the process model in IIS 5.1. It's very different to that in IIS 6 & 7 - no application pools. Have you tried using IISExpress instead? – Simon Halsey Aug 12 '11 at 15:44
  • NO I didn't tried with the Fiddler. Because I am working on Client machine. I don't have any rights to download the Fiddler and install. I will try with fiddler and update you. – Anil Kumar Aug 12 '11 at 16:02
  • How will i issue Request directly from fiddler? I know about Fiddler but didn't tried much. Could Please tell me the steps. – Anil Kumar Aug 12 '11 at 16:09
  • Thanks for your comment Antony. I have run the fiddler and it shows the Access Denied for Server Upload Folder. I Have given full rights for the IIS User. Is there anything more i have to do? – Anil Kumar Aug 12 '11 at 16:31
  • I have added the permission for ASPNET User It worked. File is uploaded to server and processed. Thanks Guys. – Anil Kumar Aug 12 '11 at 16:38

0 Answers0