Re: Error calling web service

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jeffrey Hasan (jeff_at_noreply.com)
Date: 08/23/04


Date: Mon, 23 Aug 2004 10:49:50 -0700

Make sure your settings on the Web service host virtual directory are
correct. In Directory Security check "Anonymous Access" and make sure you
are selecting a valid IUSR_ Windows account/password.

Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
-----------------------------------------------
Author of: Expert SOA in C# Using WSE 2.0 (APress, 2004)
http://www.bluestonepartners.com/soa.aspx

"John" <john@nospam.infovis.co.uk> wrote in message
news:e$OtrS$gEHA.3916@TK2MSFTNGP11.phx.gbl...
> Hi
>
> My first web service seems to be OK as I can put its url in explorer and
can
> use the invoke button to view the returned data as xml. The problem comes
> when I call it form a client app using;
>
> Dim ws As New localhost.StaffWS
> Dim ds = ws.GetStaffDiary
>
> When the second line above is executed I get a 'The request failed with
HTTP
> status 401: Access Denied.' error on the line indicated below in the
> \webreferences\localhost\references.vb file on the line indicated below;
>
>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost
> /staff/staffws/StaffWS.asmx/GetStaffDiary",
> RequestNamespace:="http://localhost/staff/staffws/StaffWS.asmx",
> ResponseNamespace:="http://localhost/staff/staffws/StaffWS.asmx",
> Use:=System.Web.Services.Description.SoapBindingUse.Literal,
> ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>
_
> Public Function GetStaffDiary() As System.Data.DataSet
> Dim results() As Object = Me.Invoke("GetStaffDiary", New Object(-1)
{})
> '<== This line has the error.
> Return CType(results(0),System.Data.DataSet)
> End Function
>
> Any idea what this error is about and how to fix it?
>
> Thanks
>
> Regards
>
>


Quantcast