c# - Windows Azure Dnn Web API routes not registering -


I am using angularJS using a module on DotNetNuke I have tested the module locally and it is fine Works, but once I install the module in production, I get this error:

WebAddress / Programs / Desktop Module / Control / Program / Programmap / GetList? Category Id = -1 & amp; Index = 0 & amp; Results = 20 404 (not found)

Are there any steps required to register these routes with the auction?

Web API

  Name space hyperlib.module.program Service {{Supported Modules ("Program") Public Class ProgramApps Controller: DNAAPI Controller {[HTTPGet, Valid Antigr. Token] [Authorize DN Module (Access Livel = DotNetAQ.Security.SecurityAccessLevel.View)] Public HTTPRPS Wanted Message GetList (Int CategoryGrid , Int index, int result) {try {Components.ProgramController PC = New Components.ProgramController (); Bool is Editable = false; If (DotNetNuke.com Common Globals.IsAditMode () & amp; amp; amp; amp; amp; amp; amp; amp; amp; moduleReaderChatModuleContent (thisActivModule); Edit = true; If (categoryId! = -1) {var program = pc.GetItemsByCondition & lt; Program & gt; ("Where ModuleId = @ 0 and ProgramCategoryId = @ 1", this.ActiveModule.ModuleID, categoryId). Where (w = & gt; w.EndDate & gt; DateTime.Now). Short (index * result). Take (results). Select (S = & gt; New ProgramWellModel (S, Wrong, Editable, This Active Module .module.tostring (), This Active Module TabID .tar ())); Return request. Create Response (HTTPTATS Code. OK, Jason Convert. Serialize Object); } Other {var program = pc.GetItems & lt; Program & gt; (This.ActiveModule.ModuleID). Where (w = & gt; w.EndDate & gt; = DateTime.Now). Exclude (index * result). (result). Select. (S => New Programmable Model (S, Wrong, Editable, This Active Module. Module.Tostring (), This Active Module TabID.ToString ()); Return request. Create Response (HTTPTATS Code. OK, Jason Convert. Serialize Object); }} Hold (exception exc) {Exceptions.LogException (exc); Return request. CreteErrorPage (HTTPTitcod International.Internet Server, "{}"); }}  

Angular service

  programs.service ('programService', function ($ http, $ q) {var baseUrl = sf.getServiceRoot (' Programs') + 'API / Program API' var config = {Header: {'module id': sf.jet module id (), 'tab id': sfgettabid (), 'request request change': sf.aatnifference value ()}} ;getList = function (index, count, catid) {var blocked = $ q.defer (); config.params = {index: index, results: count, category id: catId} $ http.get (baseUrl + '/ GetList ', Config) .success (func Tion (data) {deferred.resolve ($ parseJSON (JSON.parse (data))}}. Error (function (error) {deferred.reject (error);}); Returned; Confirmed;}}); < / Code> 

If someone else finds this problem, then I finally found out the problem. Register Routes was like the first load

  mapRouteManager.MapHttpRoute (moduleFolderName: "program", pathname: "program", url: "{controller} / {action}", default: new {Controller = "Program API", Action = "Getlist", ID = SI Stem Web. MVC URL parameters. Optional), namespace: new string [] {"[namespace]"});  

To register routes through Azure, this overload does not work for any reason. I had to change it to:

  mapRouteManager.MapHttpRoute ("program", "default", "{controller} / {action}", new [] {"hyperlib.module.program Services. "});  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -