Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 17th, 2005, 03:16 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web Services SOAP Example (Chapter 26)

From Professional C#: 3rd Edition.

I have found that (at least in my case) that you (may?) need to add PreAuthenticate code in order to get the SOAP Headers example to work. Otherwise, you will get an exception of "The request failed with HTTP status 401: Unauthorized".

I found this solution at: http://www.heybo.com/weblog/posts/245.aspx

Basically, you would need to add this code:
Code:
  myService = new Service1();
  myService.PreAuthenticate = true;
  myService.Credentials = 
     System.Net.CredentialCache.DefaultCredentials;

  AuthenticationToken header = new AuthenticationToken();
Hopefully, this will save somebody some time and headaches.

Thanks,
Paul
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5 - Web Services Sample mjk12345 BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 2 July 8th, 2008 01:53 PM
Chapter 6 : Web Services and Ajax 2mk BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 February 11th, 2008 04:21 AM
Chapter 26 XML Web Services - error handing? RichDiaz BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 August 20th, 2007 04:47 PM
Web Services and SOAP Policy sloesch VB.NET 0 December 21st, 2005 12:59 PM



All times are GMT -4. The time now is 03:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.