Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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)

Posted

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

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...