I'm trying to host a custom wcf-service within my umbraco 4.7.2 site. I'm running into problems using uQuery within the service. It seems that uQuery lacks context information resulting in Null Reference Exceptions. For instance uQuery.GetRootNode() generates an exception as well as uQuery.GetNodesByType.
The code works like a charm if the request comes from a page within the umbraco content tree.
Host custom wcf service and uQuery
Hi!
I'm trying to host a custom wcf-service within my umbraco 4.7.2 site. I'm running into problems using uQuery within the service. It seems that uQuery lacks context information resulting in Null Reference Exceptions. For instance uQuery.GetRootNode() generates an exception as well as uQuery.GetNodesByType.
The code works like a charm if the request comes from a page within the umbraco content tree.
Grateful from pointers in the right direction :)
/Martin
Problem solved!
You have to use AspNetCompatibility mode. All you have to do is to add this to your system.ServiceModel-section:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
and tag your service with this:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
/Martin
is working on a reply...