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();
}
}
}
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
> > }- Hide quoted text -
>
> - Show quoted text -