mike55 Posted May 25, 2005 Posted May 25, 2005 Hi, I have created a web service that is responsible for accessing an SQL database collecting the data and then processing it in an appropriate manner. I have a windows application that then acts as a front-end which is responsible for calling the web method in the web service. I have added a reference to my windows application for the web service and have created an instance of it in the same manner as if it was a web application accessing a web service: dim ws as new wsSendMsg.wsSendMessages However when I go ws.startProcessing() 'The webmethod on the web service. I get a Http error: Http error 401 Unauthorized, access denied. Searches on the internet suggest that I must pass authentication information to the web service. My question is what authentication information and how do I pass that information. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
mike55 Posted May 25, 2005 Author Posted May 25, 2005 Ok, This is what I have found out so far, basically for a windows app to access as web service on the same machine it is necessary for the window app to pass the necessary credenticals to the web service. Therefore, just before you call the web method you call the following line of code: ws.Credentials = System.Net.CredentialCache.DefaultCredentials Where ws is equals to: Dim ws As New wsSendMsg.wsSendMessages Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.