Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ServiceBehavior( IncludeExceptionDetailInFaults = true )]
- public class TeyunaDataService : DataService< Meteora.TeyunaServices.Models.TeyunaContext >
- {
- public static void InitializeService(DataServiceConfiguration config)
- {
- config.SetEntitySetAccessRule("Clientes", EntitySetRights.AllRead );
- config.SetEntitySetAccessRule("Transacciones", EntitySetRights.All);
- config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
- config.UseVerboseErrors = true;
- }
- public TeyunaDataService()
- {
- this.ProcessingPipeline.ProcessingRequest += new EventHandler<DataServiceProcessingPipelineEventArgs>(OnRequest);
- }
- void OnRequest(object sender, DataServiceProcessingPipelineEventArgs e)
- {
- var auth = HttpContext.Current.Request.Headers["Authorization"]; //This is empty
- }
- }
- }
- OData.read({ requestUri: url, user: "pruebausr", password: "passprb" },
- function (data, request) {
- // ... code to procesing data (It works fine)
- }, function(err) {
- $.mobile.hidePageLoadingMsg();
- alert("Error al obtener clientes. " + err.message);
- }
- );
Add Comment
Please, Sign In to add comment