Setting HTTP Header Attributes

E

Eric

Hello,

I am writing an application that makes a number of web service calls
to a variety of sources and aggregates the data back on a web page. A
couple of the services require basic authentication information to be
sent as part of the post request in the http header. I have tried
setting up a credential cache and passing it as part of the service
call, but when I do a tcp-trace of the resulting data, the credential
information isn't passed in either the soap header or the http header.
The rest of the message looks correct, but since the credentials
aren't making it to the service, the message is rejected.

Here is a copy of one of the routines:

Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnGo.Click
Dim someService As aService.EmployeeService
Dim credCache As System.Net.CredentialCache
Dim netCredential As System.Net.NetworkCredential
Dim myURI As System.Uri
Dim EmployeeNumber as String
Dim EmployeeName as String

someService = New aCustomer.AccountService
credCache = New System.Net.CredentialCache
netCredential = New System.Net.NetworkCredential

myURI = New System.Uri("http://hr1/services/EmployeeInfo")

netCredential.UserName = "TestUser"
netCredential.Password = Password.text
EmployeeNumber = "12345"

credCache.Add(myURI, "Basic", netCredential)

someService.Credentials = credCache
someService.PreAuthenticate = True

EmployeeName =
someService.findByEmployeeNumber(EmployeeNumber)
End Sub

Any help/guidance on how to add the credential information to the HTTP
header would be greatly appreciated.

Thanks
- Eric
 
T

Tim Gallivan

Eric,
Have you had any response to this post? I, too, am looking for the same
thing ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top