Web Service Time Out Problem After Two Calls


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Web Service Time Out Problem After Two Calls

  1. #1
    Join Date
    Jun 2008
    Posts
    1

    Web Service Time Out Problem After Two Calls

    Hi,

    I am calling a web service in my ASP.NET (2.0) application. Web Service return a audio recording URL which i pass to Window Media player object .

    it works fine for first two call but for third call it throws exception

    "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> The operation has timed out".

    bellow is the code
    Code:
    //Create a calss which is inherited by the web service proxy calss
    
    public class ProxyChild : WebServiceProxy
    
    {
    
    public ProxyChild()
    
    {}protected override WebRequest GetWebRequest(Uri uri) 
    {
    
    HttpWebRequest webRequest = (HttpWebRequest)base.GetWebRequest(uri);
    
    webRequest.KeepAlive = false; 
    webRequest.ReadWriteTimeout = 600000;
    
    webRequest.Timeout = 600000;
    
    return webRequest; 
    }
    
    }
    
    //Main Class which call web service method
    
    public partial class AudioPlayer : System.Web.UI.Page 
    {
    
    protected void Page_Load(object sender, EventArgs e) 
    {
    
    GetWebUrl(); 
    }
    
    private void GetWebUrl() 
    {
    
    string WebAccessPath=null; 
    StringBuilder sb = new StringBuilder();
    
    CampaignManagement campaignManagment = new ProxyChild();
    
    WebAccessPath = campaignManagment.GetUrl();
    
    sb.Append("<OBJECT ID=\"MediaPlayer\" WIDTH=\"310\" HEIGHT=\"100\""); 
    sb.Append("CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" STANDBY=\"Loading ");
    
    sb.Append("Windows "); 
    sb.Append("Media Player components...\" TYPE=\"application/x-oleobject\" VIEWASTEXT> ");
    
    sb.Append("<PARAM NAME=\"FileName\" VALUE=\"" + WebAccessPath + "\"> "); 
    sb.Append("<PARAM name=\"autostart\" VALUE=\"true\"> ");
    
    sb.Append("<PARAM name=\"ShowControls\" VALUE=\"true\"> "); 
    sb.Append("<param name=\"ShowStatusBar\" value=\"true\"> ");
    
    sb.Append("<PARAM name=\"ShowDisplay\" VALUE=\"false\"> "); 
    sb.Append("<EMBED TYPE=\"application/x-mplayer2\" NAME=\"MediaPlayer\"> ");
    
    sb.Append("</EMBED> "); 
    sb.Append("</OBJECT> ");
    
    this.AudioPlayerdiv.InnerHtml = sb.ToString();// AudioPlayerdiv is the Name of server side div
    
    } 
    }
    Is there any suggestion I am facing this problem from a week but did not find any solution
    Last edited by Hack; 06-19-2008 at 09:25 AM. Reason: Added Code Tags

  2. #2
    Join Date
    Dec 2007
    Posts
    26
    hi!
    Have you been able to profile GetWebURL and find a line of code where it hangs? My suspicion would be some kind of threadlock over a resource in the constructor to ProxyChild, if the previous two instances are still waiting to be handled by garbage collection?

    Stephen Lowe
    disclaimer: though I work for Microsoft as an Architect Evangelist, my opinions (and occasional errors) are my own.

Similar Threads

  1. Problem with web service call from applet
    By Slava Gomzin in forum Java
    Replies: 3
    Last Post: 01-10-2008, 06:58 PM
  2. Java Web Service Problem
    By wakanpaladin in forum Java
    Replies: 1
    Last Post: 12-07-2007, 03:27 PM
  3. Web Service Distribution Problem
    By Deepak Chadda in forum .NET
    Replies: 0
    Last Post: 08-13-2003, 10:23 AM
  4. Referencing remote DLL in Web Service
    By Partha in forum .NET
    Replies: 0
    Last Post: 02-13-2003, 01:21 AM
  5. web service authentication mechanisms
    By Dan Davis in forum .NET
    Replies: 0
    Last Post: 05-16-2001, 04:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center