Bug 34 - Calling SSRS fails with error 401 Unauthorized
Summary: Calling SSRS fails with error 401 Unauthorized
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 4.x
Hardware: Other Other
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-07-21 12:41 UTC by Berndt H.
Modified: 2011-07-28 18:34 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Proxy class and class to call the service, SSRS needed.... (17.10 KB, application/zip)
2011-07-21 12:41 UTC, Berndt H.

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Berndt H. 2011-07-21 12:41:39 UTC
Created attachment 8 [details]
Proxy class and class to call the service, SSRS needed....

*) Created a proxy  to the SSRS WebService using Silverlight Tools
*) Created a silverlight test client to call SSRS
*) Ported everything to MonoTouch
*) Running the App gives exception in emu:

System.Web.NetException: There was an error processing web request: Status Code 401 (Unauthorized)

*) Using the same user and pwd in Firefox or Safari succeeds
Comment 1 Sebastien Pouliot 2011-07-25 14:39:28 UTC
Just to make sure, SSRS == "SQL Server Reporting Services" right ?

Does your SL application worked under Moonlight, or using Mono (and a different app) ? 

If it works on Mono (or Moonlight) then there's likely something MonoTouch specific we're missing (or mis-initializing). 

In any case a network trace (using wireshark) would be very useful to see what's being exchanged (and the authentication method being used) and let us build a test case that does not requires SSRS :)
Comment 2 Berndt H. 2011-07-28 18:34:22 UTC
Got it to work:
*) Created a WebService Proxy in VS2010 (before it was a WCF proxy created using SlSvcUtil)
*) Tried (but fails in Mono/MoonoTouch with error 401, on the 1st ws call):
 cache.Add( new Uri(rs.Url), "Negotiate", new NetworkCredential("myuser", "mypwd", null)); 
*) Tried, and this works:
 cache.Add( new Uri(rs.Url), "NTLM", new NetworkCredential("myuser", "mypwd", null));