开发者

What is causing this 403 error with my webservice?

开发者 https://www.devze.com 2022-12-22 11:21 出处:网络
I\'m wondering whether I\'m recieving the 403 errors because th开发者_开发技巧ere are too many attempted connections being made to the webservice? If this is the case how do I get around it. I\'ve tri

I'm wondering whether I'm recieving the 403 errors because th开发者_开发技巧ere 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 are 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.

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


In HTTP a 403 error should be caused by an authorization error.

Assuming that the web server you are communicating with is following the HTTP standard, then the 403 error would be caused by incorrect credentials.

0

精彩评论

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

关注公众号