The javascript works with some ServiceStack REST methods, that are called on the url's like:
/ucommerceapi/Json/SyncReply/GetProductVariations
Those urls give me the generic Umbraco 404, and it seems that there is no config of the servicestack http module in the web.config. Where is the httpmodule supposed to be configured? Should the installer take care of it?
If you're integrating with a Web Framework that uses HTTP Modules than it's possible that they'll choose to hijack all HTTP Requests. ASP.NET MVC is an example that does this. Which is why to get around this you need to add an ignore route rule in the MvcApplication.RegisterRoutes() configuration, e.g:
This tells MVC to ignore routes that starts with /api/* (i.e. where ServiceStack is hosted) and it will fallback to using any of the ASP.NET HttpHandlers registered for that path in the Web.Config. It's likely you'd need to do something similar to get ServiceStack to work in Umbraco, but as I've never used it I'm not sure where that is.
Thanks Tim and Demis. I copied the Global.asax from the Rozer project source, and added the stuff from the web.config as well, and now I am getting the services metadata and so on :-)
I have a hosted environment where I'm still getting a 404 error message e.g. when trying to add something to the shopping cart. I've double checked the installation steps -- everything is fine: web.config, core.config and all assemblies are there.
On my local dev machine everything is working fine.
The hosted environment (where it is hard for me to debug) is running IIS 7.
I found a reference to this solution somewhere through the mingle of threads I was reading. Basically, i had to add one line to the AppHost.cs file in the UCommerce.Razorstore project, then rebuild and redeploy:
Handler for Request not found:
Request.HttpMethod: GET
Request.HttpMethod: GET
Request.PathInfo: /ucommerceapi/Json/SyncReply/GetProductVariations
Request.QueryString:
Request.RawUrl: /ucommerceapi/Json/SyncReply/GetProductVariations
I followed the suggestions described here and in the setup readme of the razor store.
I had to manually add the 'ServiceStackApi' entry to the core.config, but my web.config and urlrewriting.config files matched what was described.
The error still appears each time i load the product page, or change the selection in the 'collar size' list.
I see mention of copying a global.asax file, but i don't see that file in the store source project i brought down, or in the website after having installed the store package. Is that a key piece, and if so where do i find that file?
I believe i was using a package I downloaded on 11/20/12, but i also had a version of the project i had downloaded on 11/14/12 and built. I'm not certain which version i actually used...
I grabbed the latest version of uCommerce and the razor store as of today (11/28/12) and ran through the installation process on a new umbraco site.
After completing the main install/setup steps, I hit the root of the store, browsed to a product, and attempted to change the product options. I received the same error as i had last time:
ServiceStack REST methods 404 on uCommerce 3.0
I've been playing around with the fresh uCommerce 3.0 and the new Razor sample site https://bitbucket.org/uCommerce/ucommerce-razor-store/
The javascript works with some ServiceStack REST methods, that are called on the url's like:
/ucommerceapi/Json/SyncReply/GetProductVariations
Those urls give me the generic Umbraco 404, and it seems that there is no config of the servicestack http module in the web.config. Where is the httpmodule supposed to be configured? Should the installer take care of it?
Any hints? :-)
Sorry Morten that's my fault, there's an issue with global.asax in the package.
If you copy over the asax there's also a couple of config setting in the root of the project folder which you'll need.
I'll write docs shortly
I don't know much about Umbraco, but ServiceStack doesn't use any HTTP modules it only uses ASP.NET IHttpHandler mappings to register itself.
Since you want to host ServiceStack with an existing WebHost you want include the Web.Config required to host ServiceStack at a custom path, e.g: /api
See the Hello World config for an example: http://www.servicestack.net/ServiceStack.Hello/#custompath
If you're integrating with a Web Framework that uses HTTP Modules than it's possible that they'll choose to hijack all HTTP Requests. ASP.NET MVC is an example that does this. Which is why to get around this you need to add an ignore route rule in the MvcApplication.RegisterRoutes() configuration, e.g:
Global.asax.cs :: MvcApplication.RegisterRoutes(RouteCollection):
routes.IgnoreRoute("api/{*pathInfo}");
This tells MVC to ignore routes that starts with /api/* (i.e. where ServiceStack is hosted) and it will fallback to using any of the ASP.NET HttpHandlers registered for that path in the Web.Config. It's likely you'd need to do something similar to get ServiceStack to work in Umbraco, but as I've never used it I'm not sure where that is.
Thanks Tim and Demis. I copied the Global.asax from the Rozer project source, and added the stuff from the web.config as well, and now I am getting the services metadata and so on :-)
and
Also Tim did some docs for setting up the Razor store which include info on the manual steps required for now.
Hi everyone!
I have a hosted environment where I'm still getting a 404 error message e.g. when trying to add something to the shopping cart. I've double checked the installation steps -- everything is fine: web.config, core.config and all assemblies are there.
On my local dev machine everything is working fine.
The hosted environment (where it is hard for me to debug) is running IIS 7.
Do you have any hints for me?
Thanks!
Henk
Update: solved!
I found a reference to this solution somewhere through the mingle of threads I was reading. Basically, i had to add one line to the AppHost.cs file in the UCommerce.Razorstore project, then rebuild and redeploy:
Once i did that, no more '404' when looking for the handler!
===== original issue below, for future reference =====
Apologies if there is a double post, I had a problem when i first tried replying...
I'm receiving this error as well:
Additional details if it helps, here is more detail on the post/response per filezilla:
I followed the suggestions described here and in the setup readme of the razor store.
I had to manually add the 'ServiceStackApi' entry to the core.config, but my web.config and urlrewriting.config files matched what was described.
The error still appears each time i load the product page, or change the selection in the 'collar size' list.
I see mention of copying a global.asax file, but i don't see that file in the store source project i brought down, or in the website after having installed the store package. Is that a key piece, and if so where do i find that file?
It really should happen automatically with the latest version of the store. When did you download the version you're testing out?
I've downloaded it on nov 19.
@e: I will try that!
I believe i was using a package I downloaded on 11/20/12, but i also had a version of the project i had downloaded on 11/14/12 and built. I'm not certain which version i actually used...
Just an update:
I grabbed the latest version of uCommerce and the razor store as of today (11/28/12) and ran through the installation process on a new umbraco site.
After completing the main install/setup steps, I hit the root of the store, browsed to a product, and attempted to change the product options. I received the same error as i had last time:
Steps I have taken to resolve:
* I had to manually update /ucommerce/configuration/core.config to add the following node just before the closing </components> node:
<component id="ServiceStackApi" service="uCommerce.RazorStore.ServiceStack.AppHost, uCommerce.RazorStore" type="uCommerce.RazorStore.ServiceStack.AppHost, uCommerce.RazorStore" lifestyle="Singleton"/>
* I then updated the AppHost.cs file in the UCommerce.RazorStore project, in the ServiceStack folder to add a line to the 'Configure' method (per here: http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/35314-ServiceStack-REST-methods-404-on-uCommerce-30?p=0#comment132028)
After a rebuild/redeploy of UCommerce.RazorStore.dll, the website works as expected when calling the ServiceStack items.
Thanks for being awesome and posting the follow-up. I will do some testing on this end with regards to this.
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.