This is a migrated thread and some comments may be shown as answers.

[Solved] RadGrid bound to WCF Web Service - Providing message ClientCredentials?

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arthur Rogers
Top achievements
Rank 1
Arthur Rogers asked on 24 Aug 2009, 11:50 AM

In the sample online scenario "RadGrid bound to WCF Web Service" the sample code binds to a WCF method. The sample client settings are below (I copied them straight from the sample code)
          <ClientSettings>
                <DataBinding SelectMethod="GetDataAndCount" Location="GridWcfService.svc"
                    SortParameterType="Linq" FilterParameterType="Linq">
                </DataBinding>
            </ClientSettings>
           
Now if the endpoint (which GetDataAndCount() belongs) requires message level encryption how do I provide credentials as part of the client call?

For instance in the code behind the following is how I would have performed this on the server side...
     
           MySampleClient ac = new MySampleClient("SampleEndpointWSHttpBinding");
            ac.ClientCredentials.UserName.UserName = Session["Username"].ToString();
            ac.ClientCredentials.UserName.Password = Session["Password"].ToString();
            List<DataPoints> dp = ac.GetDataAndCount(...);

So how do you do this on the client side. Any help appreciated

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 25 Aug 2009, 10:15 AM
Hi Arthur,

In order to pass additional parameters when using declarative data binding, you should use client-side DataBinding event. Please refer to this online example for more details on how to achieve this (there is a sample code in the handler's implementation which demonstrates the needed steps).

Best wishes,
Rosen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Arthur Rogers
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or