none
Create System.Data.Services.Client.DataServiceContext instance with Parameter in URI RRS feed

  • Question

  • Hello 

    I am using WCF services . then I add service reference to my WPF project then Class1 inherited from  System.Data.Services.Client.DataServiceContext automaticaly get generated.

    But When I try to create its instance with URI (Uri contains UserName & Password as parameter) at that time it is giving error that "Expected an absolute, well formed http URL without a query or fragment.".

     Uri uriObj = new Uri("http://localhost:54002/CustomAuthenticationDataService.svc?UserName=Admin&Password=");
                    dc = new WpfApplication1.ServiceReference1.CustomAuthenticationService(uriObj);

    If I remove Bolded part then It is working fine. But I want to create it for Particular user. So how to pass Parameter in it?

    Monday, June 3, 2013 9:42 AM

Answers