openrasta/openrasta-stable — Issue #29: Post overrides
Author: rik1083
Created: 2011-12-20 12:07:38+00:00
State: open

Hi, It seems to choose the wrong method for posting in this situation:
it chooses the override with the Int/account_id with a higher score than the one without, even though the url I'm posting to is the simpler one. Is this something I'm missing at configuration level?

Configuration:

ResourceSpace.Has.ResourcesOfType()
.AtUri("/domain/new")
.And.AtUri("/account/{account_id}/domain/new")
.HandledBy()
.RenderedByAspx("~/Views/domain/DomainViewNew.aspx")
.And.AsJsonDataContract()
.And.AsXmlDataContract();

5-[2011-12-20 11:58:54Z] Verbose(0) Starts pre-executing the request.
5-[2011-12-20 11:58:54Z] Verbose(0) Incoming host request for http://localhost:61073/domain/new
5-[2011-12-20 11:58:54Z] Verbose(0) Adding communication context data
5-[2011-12-20 11:58:54Z] Warning(0) Contributor call for BootstrapperContributor had a null Action.
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor HttpMethodOverriderContributor.OverrideHttpVerb
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor DigestAuthorizerContributor.ReadCredentials
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor UriDecoratorsContributor.ProcessDecorators
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor ResourceTypeResolverContributor.ResolveResource
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Verbose(0) Rewrote path.
5-[2011-12-20 11:58:54Z] Start(1) Entering OpenRastaRewriterHandler: Rewriting to original path
5-[2011-12-20 11:58:54Z] Start(1) Entering OpenRastaIntegratedHandler: Request for http://localhost:61073/domain/new
5-[2011-12-20 11:58:54Z] Verbose(0) Incoming host request for http://localhost:61073/domain/new
5-[2011-12-20 11:58:54Z] Verbose(0) Adding communication context data
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor HandlerResolverContributor.ResolveHandler
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationCreatorContributor.CreateOperations
5-[2011-12-20 11:58:54Z] Verbose(0) Created operation named Get wth signature DomainHandlerNew::Get()
5-[2011-12-20 11:58:54Z] Verbose(0) Created operation named Get wth signature DomainHandlerNew::Get(Int32 account_id)
5-[2011-12-20 11:58:54Z] Verbose(0) Created operation named Post wth signature DomainHandlerNew::Post(DomainResourceNew post)
5-[2011-12-20 11:58:54Z] Verbose(0) Created operation named Post wth signature DomainHandlerNew::Post(Int32 account_id, DomainResourceNew post)
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationFilterContributor.ProcessOperations
5-[2011-12-20 11:58:54Z] Verbose(0) Found 2 operation(s) with a matching name.
5-[2011-12-20 11:58:54Z] Verbose(0) Found 0 operation(s) with matching [HttpOperation] attribute.
5-[2011-12-20 11:58:54Z] Verbose(0) No resource or no uri name. Not filtering.
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationCodecSelectorContributor.ProcessOperations
5-[2011-12-20 11:58:54Z] Information(0) Operation DomainHandlerNew::Post(Int32 account_id, DomainResourceNew post) selected with 2 required members and 0 optional members, with codec ApplicationXWwwFormUrlencodedKeyedValuesCodec with score 0.8333334.
5-[2011-12-20 11:58:54Z] Information(0) Operation DomainHandlerNew::Post(DomainResourceNew post) selected with 1 required members and 0 optional members, with codec ApplicationXWwwFormUrlencodedKeyedValuesCodec with score 0.5.
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationHydratorContributor.ProcessOperations
5-[2011-12-20 11:58:54Z] Information(0) Operation DomainHandlerNew::Post(Int32 account_id, DomainResourceNew post) was selected with a codec score of 0.8333334
5-[2011-12-20 11:58:54Z] Information(0) Loaded codec OpenRasta.Codecs.ApplicationXWwwFormUrlencodedKeyedValuesCodec
5-[2011-12-20 11:58:54Z] Information(0) Codec supports IKeyedValuesMediaTypeReader. Processing parameters.
5-[2011-12-20 11:58:54Z] Verbose(0) Key domain_name was not successfully assigned.
5-[2011-12-20 11:58:54Z] Verbose(0) Key submit was not successfully assigned.
5-[2011-12-20 11:58:54Z] Verbose(0) Key domain_name was successfully assigned.
5-[2011-12-20 11:58:54Z] Verbose(0) Key submit was not successfully assigned.
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationInterceptorContributor.WrapOperations
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationInvokerContributor.ExecuteOperations
5-[2011-12-20 11:58:54Z] Verbose(0) Ignoring constructor, following dependencies didn't have a registration:OpenRasta.OperationModel.Interceptors.IOperationInterceptor[]
A first chance exception of type 'System.InvalidOperationException' occurred in OpenRasta.DLL
5-[2011-12-20 11:58:54Z] Error(0) An error of type System.InvalidOperationException has been thrown
5-[2011-12-20 11:58:54Z] Error(0) System.InvalidOperationException: The operation is not ready for invocation.
5-[2011-12-20 11:58:54Z] Error(0) at OpenRasta.OperationModel.MethodBased.MethodBasedOperation.Invoke() in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\MethodBased\MethodBasedOperation.cs:line 56
5-[2011-12-20 11:58:54Z] Error(0) at OpenRasta.OperationModel.Interceptors.OperationWithInterceptors.b__0() in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\Interceptors\OperationWithInterceptors.cs:line 47
5-[2011-12-20 11:58:54Z] Error(0) at OpenRasta.OperationModel.Interceptors.OperationWithInterceptors.Invoke() in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\Interceptors\OperationWithInterceptors.cs:line 52
5-[2011-12-20 11:58:54Z] Error(0) at OpenRasta.OperationModel.OperationExecutor.Execute(IEnumerable`1 operations) in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\OperationExecutor.cs:line 14
5-[2011-12-20 11:58:54Z] Error(0) at OpenRasta.Pipeline.Contributors.OperationInvokerContributor.ExecuteOperations(ICommunicationContext context) in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\Pipeline\Contributors\OperationInvokerContributor.cs:line 29
5-[2011-12-20 11:58:54Z] Error(0) at OpenRasta.Pipeline.PipelineRunner.ExecuteContributor(ICommunicationContext context, ContributorCall call) in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\Pipeline\PipelineRunner.cs:line 172
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Error(0) Aborting the pipeline and rendering the errors.
5-[2011-12-20 11:58:54Z] Error(0) An error has occurred and the processing of the request has stopped.

Exception:
System.InvalidOperationException: The operation is not ready for invocation.
at OpenRasta.OperationModel.MethodBased.MethodBasedOperation.Invoke() in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\MethodBased\MethodBasedOperation.cs:line 56
at OpenRasta.OperationModel.Interceptors.OperationWithInterceptors.b__0() in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\Interceptors\OperationWithInterceptors.cs:line 47
at OpenRasta.OperationModel.Interceptors.OperationWithInterceptors.Invoke() in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\Interceptors\OperationWithInterceptors.cs:line 52
at OpenRasta.OperationModel.OperationExecutor.Execute(IEnumerable`1 operations) in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\OperationModel\OperationExecutor.cs:line 14
at OpenRasta.Pipeline.Contributors.OperationInvokerContributor.ExecuteOperations(ICommunicationContext context) in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\Pipeline\Contributors\OperationInvokerContributor.cs:line 29
at OpenRasta.Pipeline.PipelineRunner.ExecuteContributor(ICommunicationContext context, ContributorCall call) in c:\_Projects\SteveDunn-openrasta-stable-0acdf3b\SteveDunn-openrasta-stable-0acdf3b\src\core\OpenRasta\Pipeline\PipelineRunner.cs:line 172
5-[2011-12-20 11:58:54Z] Verbose(0) Pipeline is in RenderNow mode.
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor OperationResultInvokerContributor.RunOperationResult
5-[2011-12-20 11:58:54Z] Information(0) Executing OperationResult OperationResult: type=InternalServerError, statusCode=500.
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor ResponseEntityCodecResolverContributor.FindResponseCodec
5-[2011-12-20 11:58:54Z] Information(0) Selected codec HtmlErrorCodec out of 4 codecs for entity of type ServerErrorList and negotiated media type text/html.
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor DigestAuthorizerContributor.WriteCredentialRequest
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Start(1) Entering PipelineRunner: Executing contributor ResponseEntityWriterContributor.WriteResponse
5-[2011-12-20 11:58:54Z] Verbose(0) Codec HtmlErrorCodec selected.
5-[2011-12-20 11:58:54Z] Start(1) Entering ResponseEntityWriterContributor: Generating response entity.
5-[2011-12-20 11:58:54Z] Verbose(0) Setting Content-Length to 512
5-[2011-12-20 11:58:54Z] Stop(1) Exiting ResponseEntityWriterContributor
5-[2011-12-20 11:58:54Z] Verbose(0) Writing http headers.
5-[2011-12-20 11:58:54Z] Verbose(0) Writing http header Content-Length:512
5-[2011-12-20 11:58:54Z] Verbose(0) Writing http header Content-Type:text/html
5-[2011-12-20 11:58:54Z] Stop(1) Exiting PipelineRunner
5-[2011-12-20 11:58:54Z] Information(0) Pipeline finished.
5-[2011-12-20 11:58:54Z] Stop(1) Exiting OpenRastaIntegratedHandler
5-[2011-12-20 11:58:54Z] Stop(1) Exiting OpenRastaRewriterHandler
5-[2011-12-20 11:58:54Z] Verbose(0) Request finished.
The thread '' (0x24a4) has exited with code 0 (0x0).