【问题标题】:Sitecore pipeline interfering with WebMethod (asmx) invocationSitecore 管道干扰 WebMethod (asmx) 调用
【发布时间】:2012-06-23 08:18:10
【问题描述】:

关于一个简单的网络方法调用:

[WebMethod]
        public List<string> GetSomethingBySomethingElse(string somethingElse) {
            var results = (from w in Something
                         where w.SomethingElse == somethingElse
                         orderby w.SomethingElse
                         select w.SomethingElse).Distinct();
            return results.ToList();
        }

其他人在:http://sitecoreblog.alexshyba.com/2009/03/attach-wcf-services-to-sitecore-context.html 有同样的问题,但没有说他们是如何解决的。

堆栈跟踪:

[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +9385067
   Sitecore.Web.RequestUrl.get_ItemPath() +146
   Sitecore.Pipelines.HttpRequest.SiteResolver.GetItemPath(HttpRequestArgs args, SiteContext context) +32
   Sitecore.Pipelines.HttpRequest.SiteResolver.UpdatePaths(HttpRequestArgs args, SiteContext site) +69
   Sitecore.Pipelines.HttpRequest.SiteResolver.Process(HttpRequestArgs args) +49
   (Object , Object[] ) +64
   Sitecore.Pipelines.PipelineMethod.Invoke(Object[] parameters) +36
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +140
   Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +158
   Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +64
   Sitecore.Pipelines.CorePipeline.Run(String pipelineName, PipelineArgs args) +50
   Sitecore.Nexus.Web.HttpModule.(Object sender, EventArgs e) +326
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

【问题讨论】:

  • 您使用哪个版本的 Sitecore?

标签: c# ajax web-services sitecore


【解决方案1】:

将 Web 服务的路径添加到 web.config 中的 IgnoreUrlPrefixes 设置。每个要忽略的唯一路径都是用管道分隔的。

【讨论】:

  • 谢谢,这个让我摸不着头脑。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-11
  • 1970-01-01
  • 2013-03-31
  • 1970-01-01
相关资源
最近更新 更多