Shouldn't you just be able to expose the methods via the standard decoration of the method like in a regular WCF service?

For example:


Create contract: IAdventureWorks.cs

[ServiceContract()]
public interface IAdventureWorks
{
[OperationContract()]
IQueryable<Product> GetProducts(); [OperationContract()]
 Product GetProduct(int id);
}

Implement in your DomainService and decorate method with WebGet(..) : AdventureWorks.cs

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class AdventureWorksService : LinqToEntitiesDomainService<AdventureWorksEntities>, IAdventureWorks
{

  [WebGet(UriTemplate = "Products", ResponseFormat = WebMessageFormat.Xml)]
  public IQueryable<Product> GetProducts()
  {
   return this.ObjectContext.Products;
  }  [WebGet(UriTemplate = "Products?id={0}", ResponseFormat = WebMessageFormat.Xml)]
  public Product GetProduct(int id)
  {
   return this.ObjectContext.Products.Where(p => p.ProductID == id).FirstOrDefault();  }
}


 

Add .svc to Web Project : AdventureWorksExtService.svc

<%@ ServiceHost Service="ServiceExample.Web.Services.AdventureWorksService"%>

Add necessary config settings to web.config.

 

I realize that is not the case, but would follow the conventions that WCF has establiished outside of RIA.  Future addition?