2

次のように xslt に読み込まれる xml を提供する aspx ページがあります。

   <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この ヘッダー が含まれ ますpublic/simpeldatalist.aspx?method=rawxml&dbsqlforxml=getnews

于 2012-12-04T19:55:52.257 に答える