Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...getting error 404 in service frameworkgetting error 404 in service framework
Previous
 
Next
New Post
5/8/2012 11:16 AM
 
Hi everyone, i have the same problem with the new service framework, i tried with the simple "hello world" tutorial before trying something more elaborated and got the same problem. I noticed that in the tutorial and other posts it's used the class "ServicesRoutingManager" but when i try to implement "IServiceRouteMapper" interface, it requires to use "IMapRoute". I tried with both classes and nothing. I verified that my .dll is in the right place (installation /bin) and i recycled the application pool. I think i'm doing something wrong or need to set some configuration in iis. Thank you for the help.

public void RegisterRoutes(IMapRoute mapRouteManager)
{
mapRouteManager.MapRoute("WebServiceTest","Default", new {controller="Welcome",action="HelloWorld"}, new[] { "WebServiceTest" });
}
 
New Post
5/8/2012 11:18 AM
 
Hi everyone, i have the same problem with the new service framework, i tried with the simple "hello world" tutorial before trying something more elaborated and got the same problem. I noticed that in the tutorial and other posts it's used the class "ServicesRoutingManager" but when i try to implement "IServiceRouteMapper" interface, it requires to use "IMapRoute". I tried with both classes and nothing. I verified that my .dll is in the right place (installation /bin) and i recycled the application pool. I think i'm doing something wrong or need to set some configuration in iis. Thank you for the help.

public void RegisterRoutes(IMapRoute mapRouteManager)
        {
            mapRouteManager.MapRoute("WebServiceTest","Default", new {controller="Welcome",action="HelloWorld"}, new[] { "WebServiceTest" });
        }
 
New Post
5/10/2012 3:39 PM
 

it's difficult for me to debug this as presumably you're using the old blogs and there were some changes made since then. Here is a piece of code based on the beta2 that you can try

 

WelcomeController.cs

using System.Linq;
using System.Text;
using System.Web.Mvc;
using DotNetNuke.Web.Services;

 
 namespace SDNServices
 {
 public class WelcomeController : DnnController
 {

 [DnnAuthorize(AllowAnonymous = true)]
   
    public string HelloWorld()
 {
 return "Hello World-!";
 }
        [DnnAuthorize(AllowAnonymous = true)]
        [AcceptVerbs(HttpVerbs.Post)]  
        public ActionResult CheckSecurity()
        {
            return Json("method can be ran by anonymous users but requires post", JsonRequestBehavior.DenyGet);
        }

        [DnnAuthorize(AllowAnonymous = true)]
        [ValidateAntiForgeryToken()]
        public ActionResult DoubleNumber(int doubleMe)
        {
            int doubled = doubleMe*2;

            return Json(doubled.ToString(), JsonRequestBehavior.AllowGet);
        }
 }
 }

 MyServicesRouteMapper.cs

using DotNetNuke.Web.Services;

namespace SDNServices
 {
 public class MyServicesRouteMapper : IServiceRouteMapper
 {

     public void RegisterRoutes(IMapRoute mapRouteManager)
     {
            mapRouteManager.MapRoute("MyServices", "{controller}.ashx/{action}",
                                     new[] { "SDNServices" });
     }
 }
 }

Once created you can invoke the methods like so

http://localhost/DesktopModules/MySer...


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
5/10/2012 3:40 PM
 
Note: I've used the .ashx in the route as if you're using the classic pipeline in the 2.0 CLR version it will not work without an extension - that may be your issue (in which case consider changing the route or using integrated .net 4.0)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
6/30/2012 4:39 PM
 
Today I had to face this problem, with a module getting a 404 error while making a call to a controller in a module, that worked well on my development environment but not on an instance on Azure. If I called to the module method (that only had the HttpPost verb enabled) directly through the browser, what I noticed is that the 404 errors were "different" depending on the environment: one returned by IIS, not managed, a blue-white-red screen -this is where my module didn't work-, and one returned by ASP.net, managed, the typical 404 ASP.net message.

I was using the latest DNN 6.2 release, using the same 4.0 pipeline mode in the pool, the same file contents (including web.config and bin folders, etc.) so my first thought was that some assembly dependency was missing on the Azure instance. I installed MVC 2 runtime on Azure to test for a solution, without success. Installed MVC 3, with the same results.


To simplify the problem I built the "HelloWorldService" described on this Scott S. post (http://www.dotnetnuke.com/Resources/Blogs/EntryId/3327/Getting-Started-with-DotNetNuke-Services-Framework.aspx). On Dev environment I saw the "HelloWorld!" message, on Azure didn't, the same 404 IIS not managed message. Seems that by some reason the router was not being registered.

My surprise was that after installing the same "HelloWorldService" on other identical deployment on Azure, it worked. The only difference was the OS Family="1" (this is Windows Server 2008) and OS Family="2" (this is Windows Server 2008 R2). On the second one worked well.

After redeploying the device using OS Family="2", the problem dissapeared. I still think that is a dependency problem that is installed on 2008 R2 but not on 2008, not sure which one is.

This was my experience. Hope that helps.

David Rodriguez
DNN Cloud Team Lead Engineer | Microsoft Azure MVP | Microsoft Azure Insider / Advisor

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...getting error 404 in service frameworkgetting error 404 in service framework


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out