Dat Bui Quang
December 20th, 2002, 11:07 PM
Hi !
I create a webservice with some method (return Dataset) and test successfully !.
I add a new WebForm with datagrid display data from that method and view in browser successfully (web method return dataset and display in datagrid)
But when I use that webservice in other project (compilation successfull) then receive error message below:
May it have to do something with second project? I think Web.config files (of webservice project and test project) may be wrong !
Thanks for answers !
The request failed with HTTP status 401: Access Denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The request failed with HTTP status 401: Access Denied.
Source Error:
Line 35: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCustomers", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 36: public System.Data.DataSet GetCustomers() {
Line 37: object[] results = this.Invoke("GetCustomers", new object[0]);
Line 38: return ((System.Data.DataSet)(results[0]));
Line 39: }
Source File: c:\inetpub\wwwroot\TestService\Web References\localhost\Reference.cs Line: 37
Stack Trace:
[WebException: The request failed with HTTP status 401: Access Denied.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream) +1174
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +216
TestService.localhost.Service1.GetCustomers() in c:\inetpub\wwwroot\TestService\Web References\localhost\Reference.cs:37
TestService.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\testservice\webform1.aspx.cs:58
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263
I create a webservice with some method (return Dataset) and test successfully !.
I add a new WebForm with datagrid display data from that method and view in browser successfully (web method return dataset and display in datagrid)
But when I use that webservice in other project (compilation successfull) then receive error message below:
May it have to do something with second project? I think Web.config files (of webservice project and test project) may be wrong !
Thanks for answers !
The request failed with HTTP status 401: Access Denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The request failed with HTTP status 401: Access Denied.
Source Error:
Line 35: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetCustomers", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 36: public System.Data.DataSet GetCustomers() {
Line 37: object[] results = this.Invoke("GetCustomers", new object[0]);
Line 38: return ((System.Data.DataSet)(results[0]));
Line 39: }
Source File: c:\inetpub\wwwroot\TestService\Web References\localhost\Reference.cs Line: 37
Stack Trace:
[WebException: The request failed with HTTP status 401: Access Denied.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream) +1174
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +216
TestService.localhost.Service1.GetCustomers() in c:\inetpub\wwwroot\TestService\Web References\localhost\Reference.cs:37
TestService.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\testservice\webform1.aspx.cs:58
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263