415.0 - Unsupported Media Type

338 views
Skip to first unread message

ksen

unread,
Dec 12, 2011, 1:01:46 AM12/12/11
to OpenRasta
Hi,
I am using the Fiddler to post the data, and getting "415.0 -
Unsupported Media Type" error, Could any one recommend a solution to
this issue?
Thanks in advance, See more details below.

here is the body of the request, i set the header as application/xml
<Echo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Message>test1</Message>
</Echo>

Here is the debug log

openrasta Verbose: 0 : Incoming host request for http://localhost:8080/echo
openrasta Verbose: 0 : Adding communication context data
openrasta Start: 1 : Entering OpenRastaIntegratedHandler: Request for
http://localhost:8080/echo
openrasta Verbose: 0 : Incoming host request for http://localhost:8080/echo
openrasta Verbose: 0 : Adding communication context data
openrasta Verbose: 0 : Found 1 operation(s) with a matching name.
openrasta Verbose: 0 : Found 0 operation(s) with matching
[HttpOperation] attribute.
openrasta Information: 0 : Executing OperationResult 415
RequestMediaTypeUnsupported.
openrasta Information: 0 : No response codec was searched for. The
response entity is null or a response codec is already set.
openrasta Verbose: 0 : There was no response entity, not rendering.
openrasta Verbose: 0 : Writing http headers.
openrasta Stop: 1 : Exiting OpenRastaIntegratedHandler

Server side source code as follows.

namespace OpenRastaTest.Handlers
{
public class EchoHandler
{
public OperationResult Post(Echo echo)
{
return new OperationResult.Created()
{
ResponseResource = echo
};
}
}
}

namespace OpenRastaTest.Resources
{
public class Echo
{
public string Message { get; set; }
}
}

namespace OpenRastaTest
{

public class Configuration : IConfigurationSource
{
public void Configure()
{
ResourceSpace.Has.Resource<Echo>()
.Uri("/echo/")
.Handler<EchoHandler>()
.AsXmlSerializer();
//.OpenEverythingDoc()
//.And
//.JsonDataContract();

}
}
}

Canuck

unread,
Dec 12, 2011, 10:04:16 PM12/12/11
to OpenRasta

Could be a few thing

What header are you setting to application/xml? It should be the
Content-Type header.

Also did you mess with the pipeline at all? I am no seeing the reques
codec selection stage in you log. This would result in a 415 but maybe
I'm missing something.

On Dec 12, 1:01 am, ksen <senthil.kumaras...@gmail.com> wrote:
> Hi,
>  I am using the Fiddler to post the data, and getting "415.0 -
> Unsupported Media Type" error,  Could any one recommend a solution to
> this issue?
> Thanks in advance, See more details below.
>
> here is the  body of the request, i set the header as application/xml
> <Echo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>   <Message>test1</Message>
> </Echo>
>
> Here is the debug log
>

> openrasta Verbose: 0 : Incoming host request forhttp://localhost:8080/echo


> openrasta Verbose: 0 : Adding communication context data

> openrasta Start: 1 : Entering OpenRastaIntegratedHandler: Request forhttp://localhost:8080/echo
> openrasta Verbose: 0 : Incoming host request forhttp://localhost:8080/echo

ksen

unread,
Dec 13, 2011, 12:28:21 AM12/13/11
to OpenRasta
Thanks Canuck!, That fixed the issue.

> > }- Hide quoted text -
>
> - Show quoted text -

Canuck

unread,
Dec 13, 2011, 2:27:51 PM12/13/11
to OpenRasta
What was the issue? Was it the incorrect header or a mangled pipeline?

Senthil Kumarasamy

unread,
Dec 13, 2011, 6:54:07 PM12/13/11
to open...@googlegroups.com
incorrect header, i did not change the pipeline.
 
Thanks
ksen

Reply all
Reply to author
Forward
0 new messages