iis7에 가상 디렉터리로 여러 openrasta 응용 프로그램을 호스팅하는 사이트가 있습니다. 이 openrasta 응용 프로그램 중 하나는 단일 리소스를 호스팅하므로 가상 디렉터리의 루트에서 실행되도록합니다. 리소스를 성공적으로 가져올 수 있지만 리소스를 POST 할 수 없습니다. 게시 할 때 405 오류가 발생합니다. 내가 다른 응용 프로그램을 추가 할자료실에 공개 자료실에 게시하기
http://localhost/OpenRastaApp1/Resource1 http://localhost/OpenRastaApp1/Resource2 http://localhost/OpenRastaApp2/Resource3 http://localhost/OpenRastaApp2/Resource4
하지만,이 응용 프로그램은 1 자원이 포함됩니다 나는 앱의 기본 URI를 통해 액세스 할 : 같은
는 로컬 같습니다. 나는.
http://localhost/OpenRastaApp3 not http://localhost/OpenRastaApp3/Resource5
리소스 5를 얻을 수 있지만 아래 구성을 사용하여 POST 할 수 없습니다.
게시 할 때 ID를 포함하지 않으므로 "/ {id}"템플릿과 일치하지 않아야합니다.
ResourceSpace.Has
.ResourcesOfType<ThingResource>()
.AtUri("/").And
.AtUri("/{id}")
.HandledBy<ThingHandler>()
.AsJsonDataContract();
을 그리고 내 처리기 코드는 다음과 같습니다 :
public class ThingHandler
{
[HttpOperation(HttpMethod.POST)]
public OperationResult Post(ThingResource thingResource)
{
var thing = thingResource.ToThingEntity();
thing = _thingService.Make(thing);
return new OperationResult.OK(thing.ToThingResource());
}
[HttpOperation(HttpMethod.GET)]
public OperationResult Get(int id)
{
var thing = _thingService.Get(id);
return new OperationResult.OK(thing.ToThingResource());
}
}
디버그 로그 거기서이 나를 도울 수
13-[2011-03-01 10:38:59Z] Verbose(0) Incoming host request for http://api.local.site.com/Thing 13-[2011-03-01 10:38:59Z] Verbose(0) Adding communication context data 13-[2011-03-01 10:38:59Z] Warning(0) Contributor call for BootstrapperContributor had a null Action. 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor ExceptionHandlerContributor.LogException 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor HttpMethodOverriderContributor.OverrideHttpVerb 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor DigestAuthorizerContributor.ReadCredentials 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor UriDecoratorsContributor.ProcessDecorators 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor ResourceTypeResolverContributor.ResolveResource 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor HandlerResolverContributor.ResolveHandler 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor OperationCreatorContributor.CreateOperations 13-[2011-03-01 10:38:59Z] Verbose(0) Created operation named Post with signature ThingHandler::Post(ThingResource ThingResource) 13-[2011-03-01 10:38:59Z] Verbose(0) Created operation named Get with signature ThingHandler::Get(Int32 id) 13-[2011-03-01 10:38:59Z] Verbose(0) Created operation named Amend with signature ThingHandler::Amend(ThingResource ThingResource) 13-[2011-03-01 10:38:59Z] Verbose(0) Created operation named Cancel with signature ThingHandler::Cancel(Int32 id) 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor OperationFilterContributor.ProcessOperations 13-[2011-03-01 10:38:59Z] Verbose(0) Found 1 operation(s) with a matching name. 13-[2011-03-01 10:38:59Z] Verbose(0) Found 1 operation(s) with matching [HttpOperation] attribute. 13-[2011-03-01 10:38:59Z] Verbose(0) No resource or no uri name. Not filtering. A first chance exception of type 'System.FormatException' occurred in mscorlib.dll A first chance exception of type 'System.FormatException' occurred in mscorlib.dll A first chance exception of type 'System.Exception' occurred in System.dll A first chance exception of type 'System.NotSupportedException' occurred in OpenRasta.DLL A first chance exception of type 'System.FormatException' occurred in mscorlib.dll A first chance exception of type 'System.FormatException' occurred in mscorlib.dll A first chance exception of type 'System.Exception' occurred in System.dll A first chance exception of type 'System.NotSupportedException' occurred in OpenRasta.DLL 13-[2011-03-01 10:38:59Z] Error(0) None of the operations had members that could be matches against the uri parameters: id=Thing; 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Verbose(0) Pipeline is in RenderNow mode. 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor OperationResultInvokerContributor.RunOperationResult 13-[2011-03-01 10:38:59Z] Information(0) Executing OperationResult OperationResult: type=MethodNotAllowed, statusCode=405. 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor ResponseEntityCodecResolverContributor.FindResponseCodec 13-[2011-03-01 10:38:59Z] Information(0) No response codec was searched for. The response entity is null or a response codec is already set. 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor DigestAuthorizerContributor.WriteCredentialRequest 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Start(1) Entering PipelineRunner: Executing contributor ResponseEntityWriterContributor.WriteResponse 13-[2011-03-01 10:38:59Z] Verbose(0) There was no response entity, not rendering. 13-[2011-03-01 10:38:59Z] Verbose(0) Writing http headers. 13-[2011-03-01 10:38:59Z] Stop(1) Exiting PipelineRunner 13-[2011-03-01 10:38:59Z] Information(0) Pipeline finished.
사람을 다음과 같이 다음과 같이
내 구성은 ?
건배
데이브
게시 할 때 실제로 일어나는 일을 알려주는 디버그 로그를 추가 할 수 있다면. – SerialSeb