REST API within Windows Mobile and NET CF

rated by 0 users
Not Answered This post has 0 verified answers | 5 Replies | 2 Followers

Top 75 Contributor
261 Posts
Points 4,015
SuperJMN posted on Thu, Jun 26 2008 9:22 PM

Hello, I'm trying to make an application for writing blog entries in Windows Mobile. I managed to do it from using .NET Framework with a reference to CommunityServer.WebServices.dll and using its classes.

But now I'm developing the app for Windows Mobile and the .NET Compact Framework, so I need a new .dll that is .NET CF compliant. Need I to recompile it? What project from the CS source code should I recompile?

José Manuel Nieto
Translator of the Spanish Language Pack for Community Server 2007
Developer of CS Gallery Manager
  • | Post Points: 20

All Replies

Top 75 Contributor
261 Posts
Points 4,015
SuperJMN replied on Mon, Jun 30 2008 5:54 PM

Hi? Somebody ther? I want to use the REST API from a Windows Mobile device. I own a VS.NET 2008  SERVICE PACK 1, that is capable of using REST services, but I cannot figure out how to deal with your REST services using LINQ, for example.

Please, I really need some directions.

Any of you want a Windows Mobile post editor? So... help me!

José Manuel Nieto
Translator of the Spanish Language Pack for Community Server 2007
Developer of CS Gallery Manager
  • | Post Points: 5
Top 75 Contributor
261 Posts
Points 4,015

Everybody on vacation? Too much free time? :)

Alright, I assume that you don't know the answer, you bad programmers...!!

José Manuel Nieto
Translator of the Spanish Language Pack for Community Server 2007
Developer of CS Gallery Manager
  • | Post Points: 5
Top 10 Contributor
3,131 Posts
Points 46,475
TelligentSupportTeam

Telligent don't ship the source code for the .Net Web API client.  So without being able to compile that for the .net compact framework, you're going to have to make raw requests to the Rest API - see http://api.communityserver.org/ for more information on what URLs you need to request from.

  • | Post Points: 35
Top 75 Contributor
261 Posts
Points 4,015

Alright :) I've published my question in the ASP.NET Forums. I'm using .NET 3.5 and VS.NET 2008 SP1 and I can use its new tecnologies.

I want to make an application that can use the REST API without the wrapper classes that Telligent provides. But I don't know how to make calls to the methods correctly. The only thing that I did and that appears to be working is the authentication. I add a HTTP header to outgoing request and it's OK.

My code is as follows:

...

DataServiceContext service = new DataServiceContext(new System.Uri("http://www.superjmn.com/api/blogs.ashx"));
service.SendingRequest += new EventHandler<SendingRequestEventArgs>(service_SendingRequest);

DataServiceQuery<Post> query servicio.CreateQuery<Post>("Posts");

// The query above is not valid, but I write it to let you see how I try to make it

...

static void service_SendingRequest(object sender, SendingRequestEventArgs e) {
  string cabecera="Rest-User-Token: ";
  string token = "AppKey:SampleUser";
  byte[] tokenBytes;

  ASCIIEncoding enc = new ASCIIEncoding();
  tokenBytes=enc.GetBytes(token);

  string base64 = Convert.ToBase64String(tokenBytes);

  e.Request.Headers.Add(cabecera + base64);
}

 

Please, tell me how to, for example,  create a new blog post. Your help will be very much appreciated!

 

José Manuel Nieto
Translator of the Spanish Language Pack for Community Server 2007
Developer of CS Gallery Manager
  • | Post Points: 5
Top 75 Contributor
261 Posts
Points 4,015
SuperJMN replied on Wed, Jul 16 2008 10:35 AM
I'm getting used to the new WebService approach that Visual Studio .NET 2008 SP1 brings. It generates RESTful services that you can consume later. Since your API is not directly usable with this technology, you could at least provide some hints to connect to the service an to generate the proxy classes. I want to develop the application for the NET CF to deal with blogs. If you don't agree or don't know how to do it, I suggest you to compile a new CommunityServer.WebServices for the .NET CF , because for some reason, this assembly is obfuscated and encrypted in order to hide the code. Please, give me some help. I always give help to the community. And my project will give added value to CS. Thanks.
José Manuel Nieto
Translator of the Spanish Language Pack for Community Server 2007
Developer of CS Gallery Manager
  • | Post Points: 5
Page 1 of 1 (6 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com