Other datatypes (datetime, decimal, ..)

Topics: Web Api
Dec 20, 2010 at 11:24 AM

Hi,

a really good work and I like to see how this project will be push the wcf.

I know that the REST based service only supports string (because every parameter in a URL is a string). But is it planed to support different type in the interface? For example DateTime and than map the string value to the datetime value?  These would be save a lot of time because so you don't have to do ist by yourself ....

Thanks,
Daniel

Coordinator
Dec 20, 2010 at 11:31 AM
Yes with our next drop we will support native types. We also with our new processor model support arbitrary transformations to complex types. For example see this post http://weblogs.asp.net/cibrax/archive/2010/11/15/http-processors-in-the-wcf-web-programming-model.aspx which describes converting a portion of the uri into a CultureInfo object for localization.

On Dec 20, 2010, at 3:26 AM, "dmueller" <notifications@codeplex.com> wrote:

From: dmueller

Hi,

a really good work and I like to see how this project will be push the wcf.

I know that the REST based service only supports string (because every parameter in a URL is a string). But is it planed to support different type in the interface? For example DateTime and than map the string value to the datetime value? These would be save a lot of time because so you don't have to do ist by yourself ....

Thanks,
Daniel

Dec 20, 2010 at 12:59 PM

Cool, that sounds great! Thank you for the really quick response...

Sep 13, 2011 at 4:16 PM

I have this POST method in one of my resources:

 [WebInvoke(Method = "POST", UriTemplate = "")]
 public HttpResponseMessage<TokenResponse> Login(TokenRequest tokenRequest)

This was working fine until I added a DateTime property to the TokenRequest class. I tried using the Json,NET processor by doing:

var config = HttpHostConfiguration.Create()
                .SetMessageHandlerFactory(messageHandler)
                .UseJsonNet();

And had no luck... still getting "The server encountered an error processing the request. See server logs for more details."

Is this not supported? Should I use JsonValue instead when I need to post/put non primitive types? I'm using JsonObject and JsonValue for other resources with dynamic content, but I really liked to use the strong type alternative for some of my well-known POCO objects.

 

Thanks,

Raciel

Coordinator
Sep 13, 2011 at 6:17 PM

Try this out with our latest code drop (which is available now in our source tree). If it still doesn't work let us know.

Sep 13, 2011 at 7:52 PM

Hi Glenn,

Thanks for your response. Is there any specific binary I need to replace? I was checking my solution _used NuGet to reference WebApi_  and I'm having a hard time finding some binaries in the new drop. Were there too many changes since preview 4? I'm kind of lost.

Thanks,

Raciel