2

我有一个 aspx 页面,它提供像这样加载在 xslt 中的 xml:

   <xsl:variable name="newsurl">http://mytesturl.dk/public/simpeldatalist.aspx?method=getnews</xsl:variable>
   <xsl:variable name="news" select="msxsl:node-set(document($newsurl, /))"/>

,这在我的开发服务器上运行良好。

移动到实时服务器,这不再起作用,而是像这样抛出:

 System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials) 
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) 
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) 
at System.Xml.Xsl.Runtime.XmlQueryContext.GetDataSource(String uriRelative, String uriBase) 
--- End of inner exception stack trace --- 
at System.Xml.Xsl.Runtime.XmlQueryContext.GetDataSource(String uriRelative, String uriBase) 
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) 
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator ) 
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) 
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, Stream results) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, Stream results) 
at Dynamicweb.Base.XmlXsltParse(XmlDocument xmlDoc, XslCompiledTransform transformer, TextWriter tw, XsltArgumentList xmlargs) 

在浏览器中调用页面时,实时服务器和开发服务器都显示相同的 xml(目前为空):

<?xml version="1.0" encoding="utf-8"?>
<newsitems>
</newsitems>

将实时 xml 中的 url 更改为从测试服务器读取是可行的……所以:实时和开发服务器可以从开发中读取,但没有人可以从实时读取……

显然,实时服务器有一些设置,不允许调用该庄园的页面。

有人能想到原因吗?一些安全设置?我不确切知道要提供哪些更多信息,所以请询问您是否发现缺少一些信息...

饲料:

不会在 xslt 中加载:http ://www.osterbo.dk/public/simpeldatalist.aspx?method=rawxml&dbsqlforxml=getnews

将加载: http://osterbo.bleaudev.dk/public/simpeldatalist.aspx?method=rawxml&dbsqlforxml= getnews

问候,

斯蒂恩

4

1 回答 1

0
<xsl:variable name="newsurl">http://mytesturl.dk/public/simpeldatalist.aspx?method=getnews</xsl:variable>

应该

<xsl:variable name="newsurl">http://mytesturl.dk/public/simpeldatalist.aspx?method=rawxml&amp;dbsqlforxml=getnews</xsl:variable>

您没有正确定义查询参数,还记得在 XML 中将 & 符号转义为 & amp ;


唯一的其他区别是 http://osterbo.bleaudev.dk/public/simpeldatalist.aspx?method=rawxml&dbsqlforxml=getnews 包含此标头 X-Robots-Tag noindex,nofollow,noarchivehttp://www.osterbo.dk/ public/simpeldatalist.aspx?method=rawxml&dbsqlforxml=getnews 没有

于 2012-12-04T19:55:52.257 回答