Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Web Service Error: “The request failed with HTTP status 401: Unauthorized (http://www.velocityreviews.com/forums/t786043-web-service-error-the-request-failed-with-http-status-401-unauthorized.html)

raveesh khosa 04-11-2006 01:21 PM

Web Service Error: “The request failed with HTTP status 401: Unauthorized
 


i have made the client side NWClientForm.cs and its code is as given
below:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace NWClient
{
public partial class NWClientForm : Form
{
public NWClientForm()
{
InitializeComponent();
}

private NWWebSite.NWWebService service = new
NWWebSite.NWWebService();






private void getButton_Click_1(object sender, EventArgs e)
{
dataGridView1.DataSource = service.GetProducts();
dataGridView1.DataMember = "My Products";
}

}
}


i am getting the HTTP sattus 401:unauthorized error...

can someone pls tell the exact piece of code to be incorporated
considering that the web service is intended to require authentication
and not anonymous access..pls reply pronto...sos

*** Sent via Developersdex http://www.developersdex.com ***

Simon Hart 04-22-2006 08:40 PM

Re: Web Service Error: "The request failed with HTTP status 401: Unauthorized
 
Hi,

Try setting the service.Credentials property with a valid
System.Net.NetworkCredential object which specifies the valid user and user
password.

Regards,
Simon Hart.

"raveesh khosa" <raveesh_khosa@yahoo.com> wrote in message
news:e2lLWrWXGHA.2376@TK2MSFTNGP03.phx.gbl...
>
>
> i have made the client side NWClientForm.cs and its code is as given
> below:
>
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
>
> namespace NWClient
> {
> public partial class NWClientForm : Form
> {
> public NWClientForm()
> {
> InitializeComponent();
> }
>
> private NWWebSite.NWWebService service = new
> NWWebSite.NWWebService();
>
>
>
>
>
>
> private void getButton_Click_1(object sender, EventArgs e)
> {
> dataGridView1.DataSource = service.GetProducts();
> dataGridView1.DataMember = "My Products";
> }
>
> }
> }
>
>
> i am getting the HTTP sattus 401:unauthorized error...
>
> can someone pls tell the exact piece of code to be incorporated
> considering that the web service is intended to require authentication
> and not anonymous access..pls reply pronto...sos
>
> *** Sent via Developersdex http://www.developersdex.com ***





All times are GMT. The time now is 08:54 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57