umbraco.library:GetDocumentByUrl() not working in live environment - Umbraco 4.7.2
Hi guys
I'm struggling with something I find really really weird.
We're using the umbraco.library:GetDocumentByUrl() extension to fetch some XML from a Google site search. And it's working fine on my local setup and on our staging setup.
However it's throwing errors on the live site. When trying to debug I get the following in the tracelog. I have checked and there does not seem to be any whitespace at all even though it says something about it (Have just skimmed it to be honest)
umbracoMacro InnerException An error occurred during a call to extension function 'GetXmlDocumentByUrl'. See InnerException for a complete description of the error.
An error occurred during a call to extension function 'GetXmlDocumentByUrl'. See InnerException for a complete description of the error.
at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList1[] args)
at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Data\Web\Umbraco\4.7\CLIENT\Release\xslt\trafikplan\GoogleSiteSearch.xslt:line 28
at System.Xml.Xsl.CompiledQuery.Query.
Any clues about what could be the culprit are highly appreciated - I suspect it may be something on the server but have no clue what it could be. Everything else is working fine and several sites are running from the same install.
An error occurred while parsing EntityName. Line 3, position 106.
The hard part is figuring out if it's an error in the document you're fetching or somewhere else.
(The line you've pasted would actually throw a similar error in XSLT, since the ampersands are not escaped in the string - but I'm guessing that they got lost between copying and pasting here ...)
What's in the document you're fetching? Any URLs - 'coz they would break if they're not properly escaped, which unfortunately is very common :-)
umbraco.library:GetDocumentByUrl() not working in live environment - Umbraco 4.7.2
Hi guys
I'm struggling with something I find really really weird.
We're using the umbraco.library:GetDocumentByUrl() extension to fetch some XML from a Google site search. And it's working fine on my local setup and on our staging setup.
The XSLT snippet looks like this
However it's throwing errors on the live site. When trying to debug I get the following in the tracelog. I have checked and there does not seem to be any whitespace at all even though it says something about it (Have just skimmed it to be honest)
umbracoMacro InnerException An error occurred during a call to extension function 'GetXmlDocumentByUrl'. See InnerException for a complete description of the error. An error occurred during a call to extension function 'GetXmlDocumentByUrl'. See InnerException for a complete description of the error. at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList
1[] args) at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList
1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Data\Web\Umbraco\4.7\CLIENT\Release\xslt\trafikplan\GoogleSiteSearch.xslt:line 28 at System.Xml.Xsl.CompiledQuery.Query.Any clues about what could be the culprit are highly appreciated - I suspect it may be something on the server but have no clue what it could be. Everything else is working fine and several sites are running from the same install.
Hi Jan,
It complains about an EntityName:
The hard part is figuring out if it's an error in the document you're fetching or somewhere else.
(The line you've pasted would actually throw a similar error in XSLT, since the ampersands are not escaped in the string - but I'm guessing that they got lost between copying and pasting here ...)
What's in the document you're fetching? Any URLs - 'coz they would break if they're not properly escaped, which unfortunately is very common :-)
/Chriztian
Hi Chriztian
Well, I forgot to alter the example above. In my code it is written as &
But as I said. It's working locally and in our staging environment. It's just not working live.
The funny thing is that we're using an identical approach on another client where it's working in all three environments...
I stumbled upon this post about the same issue as well http://our.umbraco.org/forum/developers/xslt/11986-GetXmlDocumentByUrl-and-Proxy-issue
But I'm not sure about setting up a proxy in the web.config though...
/Jan
Turns out that I need to hardcode the domain so it did not try to fetch from a subdomain but only the main domain. After that it worked...do'h! :)
/Jan
Alright!
So the response was probably a 404 or 403 then, which made it choke on some characters in that page?
/Chriztian
is working on a reply...