So I thought I would try to implement this in Umbraco. The routing is supposed to be performed in Application_Start
in Global.asax. I saw somewhere that in Umbraco you could do that creatin a class inheriting from
umbraco.BusinessLogic.ApplicationBase.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class MsServiceRouter : umbraco.BusinessLogic.ApplicationBase { public MsServiceRouter() { Helper.LogCustom("PaulS.MsServiceRouter.ctor called"); RegisterRoutes(); } private void RegisterRoutes() { Helper.LogCustom("PaulS.MsService.RegisterRoutes called"); RouteTable.Routes.Add(new ServiceRoute("MsService", new WebServiceHostFactory(),typeof(MsService)));
} }
To ensure that it gets called I have added some logging - logs into UmbracoLog table.
This has been added to my web.config
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"> <baseAddressPrefixFilters> <add prefix="http://localhost:8080" /> </baseAddressPrefixFilters> </serviceHostingEnvironment> <standardEndpoints> <webHttpEndpoint> <!-- Configure the WCF REST service base address via the global.asax.cs file and the default endpoint via the attributes on the <standardEndpoint> element below --> <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"> <security> <transport proxyCredentialType="None" /> </security> </standardEndpoint> </webHttpEndpoint> </standardEndpoints>
To avoid Umbraco doing anything to my service calls I also added MsService to the umbracoReservedPaths
I can just add for other readers that I did managed to fix the problem. My problem was that I had set the Managed Pipeline Mode in IIS 7 to Classic - should be Integrated
Introducing WCF WebHttp Services in .NET 4 - and Umbraco
Hi
I have found this interesting sets of articles on Rest.
http://blogs.msdn.com/b/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx
So I thought I would try to implement this in Umbraco. The routing is supposed to be performed in Application_Start
in Global.asax. I saw somewhere that in Umbraco you could do that creatin a class inheriting from
umbraco.BusinessLogic.ApplicationBase.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MsServiceRouter : umbraco.BusinessLogic.ApplicationBase
{
public MsServiceRouter()
{
Helper.LogCustom("PaulS.MsServiceRouter.ctor called");
RegisterRoutes();
}
private void RegisterRoutes()
{
Helper.LogCustom("PaulS.MsService.RegisterRoutes called");
RouteTable.Routes.Add(new ServiceRoute("MsService", new WebServiceHostFactory(), typeof(MsService)));
}
}
To ensure that it gets called I have added some logging - logs into UmbracoLog table.
This has been added to my web.config
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://localhost:8080" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file
and the default endpoint via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true">
<security>
<transport proxyCredentialType="None" />
</security>
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
To avoid Umbraco doing anything to my service calls I also added MsService to the umbracoReservedPaths
My problem is that when I call
http://localhost:83/msservice/help
I get
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
The service works fine when placed outside Umbraco.
- So where is my call disappearing?
Thanks
Paul S
Hi Paul
Maybe you'll also need to add /mssservice/help to umbracoReservedUrls ?
/Jan
Hi Jan
It does not fix the problem. My consception of umbracoReservedUrls is that Umbraco does not touch anything her and below.
/Paul S
I'm having this very issue. I've added my service path to umbracoReservedUrls with no luck - just a 404.
Did you ever find a solution to this?
James
EDIT - Oops... my issue was a spelling mistake in my Route registration. Fixed. :)
I can just add for other readers that I did managed to fix the problem. My problem was that I had set the Managed Pipeline Mode in IIS 7 to Classic - should be Integrated
Now it works like a charm
/Paul S
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.