[Mono-dev] Simple web service test with windows authentication

Rafael Teixeira monoman at gmail.com
Thu Nov 27 15:28:12 EST 2008


AFAIK, we don't implement the proprietary protocol for Windows
Authentication.
See
http://msdn.microsoft.com/en-us/library/ms978378.aspx#authaspdotnet_authentication
for an overview with alternatives.

On Wed, Nov 26, 2008 at 3:39 PM, marcos b <marcosb at internet.com.uy> wrote:

>
> I'm trying to do a web service invocation using mono. The web service is
> hosted on my machine using iis. Windows authentication is used in the
> web.config and in iis.
> The test runs ok using .net environment but throws an Unauthorized
> exception
> when using mono.
>
> I don't know if this is a bug or I'm missing something...
>
> Thanks in advance
>
>        [Test]
>        public void WebServiceTest()
>        {
>            WS.Service1 s=new app.WS.Service1();
>            //s.UseDefaultCredentials = true;    //Also throws an exception
>            //s.Credentials = CredentialCache.DefaultCredentials;  //Also
> throws an exception
>            s.Credentials = new NetworkCredential("myLogin", "12345678",
> "myDomain");
>            Assert.AreEqual(s.Add(3,5),8);
>        }
>
> Exception
>
> detail-----------------------------------------------------------------------------
>
> TestCase 'app.MonoWebTests.WebServiceTest'
> failed: System.Net.WebException : The request failed with HTTP status 401:
> Unauthorized
>        at
> System.Web.Services.Protocols.SoapHttpClientProtocol.ReceiveResponse
> (System.Net.WebResponse response,
> System.Web.Services.Protocols.SoapClientMessage message,
> System.Web.Services.Protocols.SoapExtension[] extensions) [0x00000]
>        at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke
> (System.String method_name, System.Object[] parameters) [0x00000]
>        at app.WS.Service1.Sumar (Int32 a, Int32 b) [0x00000]
>        at (wrapper remoting-invoke-with-check) app.WS.Service1:Sumar
> (int,int)
>        at app.MonoWebTests.WebServiceTest () [0x00000]
>        at (wrapper managed-to-native)
> System.Reflection.MonoMethod:InternalInvoke
> (object,object[],System.Exception&)
>        at System.Reflection.MonoMethod.Invoke (System.Object obj,
> BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x00000]
>
> --
> View this message in context:
> http://www.nabble.com/Simple-web-service-test-with-windows-authentication-tp20705699p20705699.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



-- 
Rafael "Monoman" Teixeira
---------------------------------------
"I myself am made entirely of flaws, stitched together with good
intentions."
Augusten Burroughs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081127/81fc3e99/attachment.html 


More information about the Mono-devel-list mailing list