Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 17th, 2005, 03:16 PM
Authorized User
 
Join Date: Jun 2003
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.