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.Staff WS
Dim ds = ws.GetStaffDiar y
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\refer ences.vb file on the line indicated below;
<System.Web.Ser vices.Protocols .SoapDocumentMe thodAttribute(" http://localhost
/staff/staffws/StaffWS.asmx/GetStaffDiary",
RequestNamespac e:="http://localhost/staff/staffws/StaffWS.asmx",
ResponseNamespa ce:="http://localhost/staff/staffws/StaffWS.asmx",
Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal,
ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)> _
Public Function GetStaffDiary() As System.Data.Dat aSet
Dim results() As Object = Me.Invoke("GetS taffDiary", New Object(-1) {})
'<== This line has the error.
Return CType(results(0 ),System.Data.D ataSet)
End Function
Any idea what this error is about and how to fix it?
Thanks
Regards 4 1389
It looks as if the web service requires credentials to authenticate
the incoming request. From a client application you can pass
credentials along with the request:
ws.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
DefaultCredenti als will represent the credentials of the user running
the client process.
HTH,
--
Scott http://www.OdeToCode.com
On Tue, 17 Aug 2004 01:20:14 +0100, "John" <jo**@nospam.in fovis.co.uk>
wrote: 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.Staff WS Dim ds = ws.GetStaffDiar y
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\refe rences.vb file on the line indicated below;
<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "http://localhost /staff/staffws/StaffWS.asmx/GetStaffDiary", RequestNamespa ce:="http://localhost/staff/staffws/StaffWS.asmx", ResponseNamesp ace:="http://localhost/staff/staffws/StaffWS.asmx", Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal , ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)> _ Public Function GetStaffDiary() As System.Data.Dat aSet Dim results() As Object = Me.Invoke("GetS taffDiary", New Object(-1) {}) '<== This line has the error. Return CType(results(0 ),System.Data.D ataSet) End Function
Any idea what this error is about and how to fix it?
Thanks
Regards
John,
A followup note. Creating credentials really isn't too difficult but if you
want a component that will make it a bit easier I have one freely available
on my website, www.aboutfortunate.com. All the code on the site is free. And
all components are downloadable as Visual Studio.NET v1.1 projects. (So even
if you don't want to use the component as is you can at least use the code
as an example to follow.)
The component you'd be interested in is the Authentication component. Just
click the "Code Library" link in the top right corner of the page and then
click the "Authentication " button in the menu on the left.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:uH******** ******@TK2MSFTN GP12.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.Staff WS Dim ds = ws.GetStaffDiar y
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\refer ences.vb file on the line indicated below;
<System.Web.Ser vices.Protocols .SoapDocumentMe thodAttribute(" http://localhost /staff/staffws/StaffWS.asmx/GetStaffDiary", RequestNamespac e:="http://localhost/staff/staffws/StaffWS.asmx", ResponseNamespa ce:="http://localhost/staff/staffws/StaffWS.asmx", Use:=System.Web .Services.Descr iption.SoapBind ingUse.Literal, ParameterStyle: =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped)> _ Public Function GetStaffDiary() As System.Data.Dat aSet Dim results() As Object = Me.Invoke("GetS taffDiary", New Object(-1) {}) '<== This line has the error. Return CType(results(0 ),System.Data.D ataSet) End Function
Any idea what this error is about and how to fix it?
Thanks
Regards
Hi
The web service is really very simple. Here is the full source code; www.infovis.biz/Staff.zip. Do I still need to provide some credentials?
Thanks
Regards
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:71******** *************** *********@4ax.c om... It looks as if the web service requires credentials to authenticate the incoming request. From a client application you can pass credentials along with the request:
ws.Credentials = System.Net.Cred entialCache.Def aultCredentials ;
DefaultCredenti als will represent the credentials of the user running the client process.
HTH,
-- Scott http://www.OdeToCode.com
On Tue, 17 Aug 2004 01:20:14 +0100, "John" <jo**@nospam.in fovis.co.uk> wrote:
Hi
My first web service seems to be OK as I can put its url in explorer and
canuse 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.Staff WS Dim ds = ws.GetStaffDiar y
When the second line above is executed I get a 'The request failed with
HTTPstatus 401: Access Denied.' error on the line indicated below in the \webreferences \localhost\refe rences.vb file on the line indicated below;
<System.Web.Se rvices.Protocol s.SoapDocumentM ethodAttribute( "http://localhos
t /staff/staffws/StaffWS.asmx/GetStaffDiary", RequestNamespa ce:="http://localhost/staff/staffws/StaffWS.asmx", ResponseNamesp ace:="http://localhost/staff/staffws/StaffWS.asmx", Use:=System.We b.Services.Desc ription.SoapBin dingUse.Literal ,
ParameterStyle :=System.Web.Se rvices.Protocol s.SoapParameter Style.Wrapped)>
_ Public Function GetStaffDiary() As System.Data.Dat aSet Dim results() As Object = Me.Invoke("GetS taffDiary", New Object(-1)
{})'<== This line has the error. Return CType(results(0 ),System.Data.D ataSet) End Function
Any idea what this error is about and how to fix it?
Thanks
Regards
Hi John:
It doesn't look like you need them, but check the IIS settings also.
Perhaps anonymous access has been disallowed.
--
Scott http://www.OdeToCode.com
On Tue, 17 Aug 2004 11:46:49 +0100, "John" <jo**@nospam.in fovis.co.uk>
wrote: Hi
The web service is really very simple. Here is the full source code; www.infovis.biz/Staff.zip. Do I still need to provide some credentials?
Thanks
Regards
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Van |
last post by:
Developing in C++, .Net 2003 (7.1)
Running on Windows XP SP2
My delima is that all my windows services run fine until I STOP the service
at which time I get a "The windows service terminated unexpectidly" and the
"Send error to microsoft window." I debugged through MY code and it appears
to clean itself up properly. I don't see any memory...
|
by: Francois Guerin |
last post by:
I have an application calling a web service on a different machine. The
application code runs under a local user account on the application server.
The account (identical username/password) is created on the web service
server. The web service uses Windows integrated security and ACLs are set on
the web service to allow the remote application...
|
by: jf li |
last post by:
I have a Asp.net web application and a Asp.net Web service application. The
Web application is using HtmlInputFile to get a 50M size of file selected by
end user, read the data of this file and pass the data to the web service. I
already modified both web.config files and changed maxRequestLength to
60000(kb). When I debug the upload process,...
|
by: Ted |
last post by:
I'm running a web sercvice on Win. Server 2003, and accessing it via a
vb.net application, when calling web services I get the following error and
at times a 404 error.
Server did not recognize the value of HTTP Header SOAPAction:<Name of
method>
......any advice on such errors.
|
by: Jorgen Haukland, Norway |
last post by:
Hi,
I have created a Java webservice which runs in IBM WebSphere appserver. I
take the WSDL-file and create a VS.NET WinForm application and calls the
service running on my PC and everything works fine.
So I deploy the webservice on a remote machine (Linux box) and I get an
error when calling the service. BUT: I can retrieve the WSDL and...
| |
by: shodson |
last post by:
I have a web service
http://localhost/ServiceA/ProxyService.asmx
calls
http://localhost/ServiceB/Service.asmx
And I get an error in ServiceB's method when it calls Invoke() it craps
out and returns
|
by: jimmyfishbean |
last post by:
Hi,
I am using ASP.NET (framework 1.1), Windows 2003, IIS 6.0. I have a
VB.NET web service client that connects/calls a web service written in
ASP.NET (both applications are installed on the same server).
When the web service is installed in the Default Web Site within IIS,
the web service client has no problems connecting/calling the...
|
by: Jim Underwood |
last post by:
I am having a problem with my web page timng out while retrieving a long
runnign report (90-120 seconds. I have tried modifying several settings in
various places and cannot get it to run for more than 90 seconds.
I am running VS.Net and the app is ASP.Net, written using VB.Net. The app
calls an asp.Net web service to retrieve the report. ...
|
by: Pooja |
last post by:
Hi,
I am calling a web service to get Latitude and Longitude by sending a zip
code. This is happening inside a loop (2000 - 3000 times). After say 80
times, it gives me an error - The operation has timed out. If I continue by
pressing F10, the process starts again and everything is fine. After some
time again it will stop, show me an error...
|
by: alho |
last post by:
The web service is called by a program running on pocket pc. When to
call the web service, the first call is still ok, but for the second
or later calls, it will throw "403 Forbidden" WebException. When to
test it using the web interface on pocket IE, everything is fine.
Before there was no such problem, it only happened within a week or...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |