views:

413

answers:

2

This problem is specifically in silverlight 3.0:

This the network credential object I created:

System.Net.NetworkCredential credential = new System.Net.NetworkCredential("mohammed.haroon", "abcdefg123");

And my web service is Service1

Service1 WebService = new Service1();

WebService.ClientCredentials = credential;

WebService.ExecuteSomeMethodAsync("xyz", "abc");
            WebService.ExecuteSomeMethodAsyncCompleted += WebService_ExecuteSomeMethodAsyncCompleted;

I am unable to sent credential to Webservice which is in windows authenticated, as it not possible to assign network credential to webservice ClientCredentials specifically in Sivlerlight 3.0

I need urgent help on this please respond me, if any work around to do that?

Thanks in advance. Regards Mohammed Haroon India(Hyderabad) 08106118635

+1  A: 

I understand that the .Net RIA services are a good framework for this sort of thing (i.e. authenticating from a silverlight control to a WCF webservice). You can find out more about this at silverlight.net, and the usual culprits such as Scott Guthrie and Tim Heuer have a lot of hands on examples on their blogs.

slugster
This assumes of course that the OP can modify the Web Service.
AnthonyWJones
+1  A: 

Try it like this:-

Service1 WebService = new Service1();

WebService.ClientCredentials.UserName.UserName = "mohammed.haroon";

WebService.ClientCredentials.UserName.Password = "abcdefg123";

WebService.ExecuteSomeMethodAsync("xyz", "abc");
            WebService.ExecuteSomeMethodAsyncCompleted += WebService_ExecuteSomeMethodAsyncCompleted;

The ClientCredentials property is read only but it returns an instance of ClientCredentials which only has a single (unlike its full .NET 3.5 counter-part) readonly property UserName of type UserNamePasswordClientCredential. This in turn is has read/write properties of UserName and Password.

AnthonyWJones