Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Setting HTTP Header Attributes (http://www.velocityreviews.com/forums/t783644-setting-http-header-attributes.html)

Eric 08-23-2004 06:22 PM

Setting HTTP Header Attributes
 
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

Tim Gallivan 08-25-2004 05:03 PM

Re: Setting HTTP Header Attributes
 
Eric,
Have you had any response to this post? I, too, am looking for the same
thing ...

--
Tim Gallivan
I know I'm a great teacher because when I give a lesson, the person never
comes back.

"Eric" <theengies@yahoo.com> wrote in message
news:de489efd.0408231022.7fc29906@posting.google.c om...
> 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





All times are GMT. The time now is 07:25 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.