Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi i implemented the wcf data service to my application and i am gettin error like this The webpage cannot be found .

actully i create iquerable method name like this follows
public class sample
{
sample()
{
}
 public IQueryable GetData()
        {
            System.Net.WebRequest request = System.Net.WebRequest.Create("url");
                      
             return methodname(arg1,ar2);//here actualy retuning the data as iqueryable and to another class
            //return null;
        }

public class MyCustomDataSource
   {
       public MyCustomDataSource()
       {
           sample s = new sample();
           s.GetData();

       }
   }

the data service as follows
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
       public class DataService : DataService< MyCustomDataSource >
   {
       // This method is called only once to initialize service-wide policies.
       public static void InitializeService(IDataServiceConfiguration config)
       {
           // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
           // Examples:
          config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
           // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
         //config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;


       }

      protected override MyCustomDataSource CreateDataSource()
       {
           MyCustomDataSource source = new MyCustomDataSource();
           return source;
       }

   }

so please anyone help me how can i resolve this since this is task assigned in company i am intern i don't anything about this so please please help and give me suggestion please
Posted
Updated 4-May-11 20:26pm
v2
Comments
Wannes Geysen 5-May-11 3:27am    
I don't understand the setup of your program. Please provide some more code or more explanation

1 solution

Try to use service operation for data retrieval:
http://msdn.microsoft.com/en-us/library/cc668788.aspx[^]
note: according MSDN, IQueryable: "Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified"
If you return IQueryable , I think you should implement custom linq provider over custom data source because odata protocol supports specific odata operations like $filter, $order, $expand for collections. It isn't hard: http://msdn.microsoft.com/en-us/library/bb546158.aspx[^]
 
Share this answer
 
Comments
MURARI00 21-Jun-11 7:00am    
Hi Ilya Builuk i have problem regarding the wcf data service basic authentication i explained the the my problem in the following link please help me
http://www.codeproject.com/Questions/214066/Regarding-the-wcf-data-service-basic-authenticatio

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900