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
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