Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitecore pipeline interfering with WebMethod (asmx) invocation

On a simple call to a webmethod:

[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();
        }

Someone else on : http://sitecoreblog.alexshyba.com/2009/03/attach-wcf-services-to-sitecore-context.html had the same problem but didn't say how they solved it.

Stack Trace:

[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
like image 991
issaco Avatar asked Jan 16 '23 07:01

issaco


1 Answers

Add the path to your web service to the IgnoreUrlPrefixes setting in the web.config. Each unique path to ignore is pipe-separated.

like image 94
Mark Ursino Avatar answered Jan 31 '23 10:01

Mark Ursino