Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2004

Tip: Looking for answers? Try searching our database.

Setting HTTP Header Attributes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric - 23 Aug 2004 19:22 GMT
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 - 25 Aug 2004 18:03 GMT
Eric,
Have you had any response to this post? I, too, am looking for the same
thing ...

Signature

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

> Hello,
>
[quoted text clipped - 43 lines]
> Thanks
> - Eric

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.