Webservice returning 403 error

Posted by user48408 on Stack Overflow See other posts from Stack Overflow or by user48408
Published on 2010-03-11T16:02:48Z Indexed on 2010/03/15 10:39 UTC
Read the original article Hit count: 438

Filed under:
|
|
|
|

I'm wondering whether I'm receiving the 403 errors because there are too many attempted connections being made to the webservice. If this is the case how do I get around it? I've tried creating a new instance of InternalWebService each time and disposing of the old one but I get the same problem. I've disabled the firewall and the webservice is located locally at the moment. I beginning to think it may be a problem with the credentials but the control tree is populated via the webservice at some stage. If I browse to the webmethods in my browser I can run them all.

I return an instance of the webservice from my login handler loginsession.cs:

static LoginSession()
{
    ...
    g_NavigatorWebService = new InternalWebService();
    g_NavigatorWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
    ...
}       

public static InternalWebService NavigatorWebService
{
    get
    {
        return g_NavigatorWebService;
    }
}

I have a tree view control which uses the webservice to populate itself. IncidentTreeViewControl.cs:

public IncidentTreeView()
{
    InitializeComponent();
    m_WebService    = LoginSession.NavigatorWebService;
    ...
}
public void Populate()
{
    m_WebService.BeginGetIncidentSummaryByCompany(new AsyncCallback(IncidentSummaryByClientComplete), null);
    m_WebService.BeginGetIncidentSummaryByDepartment(new AsyncCallback(IncidentSummaryByDepartmentComplete), null);
    ...
}
private void IncidentSummaryByClientComplete(IAsyncResult ar)
{
    MyTypedDataSet data = m_WebService.EndGetIncidentSummaryByCompany(ar); //403
    ..cont...
}

I'm getting the 403 on the last line.

© Stack Overflow or respective owner

Related posts about web-services

Related posts about 403