开发者

Not receiving Http Response from HttpHandler when I host in IIS

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开发者_如何学C 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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜