ForumsDevelopersNo web service?


No web service?
Author Message
mcqueene

Posted: Mar 04, 2009
Score: 0 Reference
I am trying to work in Visual Studio and create a web service that uses the API but I think that won't work and I'd like someone to confirm that there is no web service interface available.

For the record, I know a HTTPRequest object would work with the API but I am trying to use the Blackberry plug in for Visual Studio and it appears it's only data interface is via a web service project.
keef

Posted: Mar 05, 2009
Score: 0 Reference
The API uses a rest interface. Apparently you can get REST wrappers for WCF (not ASMX) web services but I haven't had any direct experience.

You could consider creating a proxy web service that wraps the Toodledo API and point your blackberry plugin at this though.

keef
mcqueene

Posted: Mar 06, 2009
Score: 0 Reference
Well I tried to quickly get a definition of REST and the only thing I came up with was

"What is REST anyway? It is an architectural style. An architectural style is a named, coordinated set of architectural constraints."

I could probably very easily write a web service that consumed the API functions for me but that would require I host the web service. Since this is something I'm doing on the side that isn't an option.

I think the short answer is that I can't use the VS plug-in because the API isn't a web service. That means I will have to get the full Blackberry JDE and that is going to take MUCH longer to develop.
Jake

Toodledo Founder
Posted: Mar 06, 2009
Score: 0 Reference
Our API is a web service. You can access it via any web connected device by sending and requesting URLs. Here is a definition of the REST interface that we use.

http://en.wikipedia.org/wiki/Representational_State_Transfer
mcqueene

Posted: Mar 06, 2009
Score: 0 Reference
I'm guessing this describes the difference and the problem:

"Big Web Services" use XML messages that follow the SOAP standard and have been popular with traditional enterprise. In such systems, there is often a machine-readable description of the operations offered by the service written in the Web Services Description Language (WSDL). The latter is not a requirement of a SOAP endpoint, but it is a prerequisite for automated client-side code generation in many Java and .NET SOAP frameworks (frameworks such as Spring, Apache Axis2 and Apache CXF being notable exceptions). Some industry organizations, such as the WS-I, mandate both SOAP and WSDL in their definition of a Web service.

More recently, RESTful Web services have been regaining popularity, particularly with Internet companies. These also meet the W3C definition, and are often better integrated with HTTP than SOAP-based services. They do not require XML messages or WSDL service-API definitions.


So while the API may be a web service it is not the type of web service that can be consumed by the Visual Studio plug-in for Blackberry development.

http://en.wikipedia.org/wiki/Web_service
Jake

Toodledo Founder
Posted: Mar 06, 2009
Score: 0 Reference
I don't have any familiarity with Visual Studio plug-in for Blackberry, so you may be right, but I find it hard to believe. All you need to do with our API is request a url and an xml document will come back to you. Does Visual Studio not have an HTTP Request method or an XML parser?
mcqueene

Posted: Mar 06, 2009
Score: 0 Reference
Posted by Toodledo:
I don't have any familiarity with Visual Studio plug-in for Blackberry, so you may be right, but I find it hard to believe. All you need to do with our API is request a url and an xml document will come back to you. Does Visual Studio not have an HTTP Request method or an XML parser?


Ahh, that's the catch. Or I should say, here's how it works as near as I can tell so far.

To add a web service in Visual Studio it must be SOAP/WSDL based, which REST is not. So that means you cannot add a REST web service as a project in VS. But there are HTTPRequest objects and such that you can use to make URL calls. I just did this with a project that connects to an EXE that downloads data from LDAP. So if I were to write this in VS I could do it easily.

But the trick is getting it on the BB. As near as I can tell you can't put any .Net code on the BB. The plug in appears to only allow JScript code. So when I create a new BB project using the plug in I'm presented with JScript code for presentation and logic and the ability to ONLY add a web service project to make data calls to a web service. I cannot use the HTTPRequest object to make the calls because it won't let me use .Net code like VB or C#.

That's my understanding so far. The alternative is to code in full Java using the JDE made by RIM along with supporting modules from Sun. They include a bunch of samples but it's not easy coding in two different languages like this.
Jake

Toodledo Founder
Posted: Mar 06, 2009
Score: 0 Reference
Ok, I understand now. Visual Studio seems pretty crippled. Hopefully you can figure something out.
keef

Posted: Mar 06, 2009
Score: 0 Reference
As stated, the easiest way to get this done is to make your own WSDL or WCF web service that wraps the Toodledo api and use this as a proxy service. WCF would be the easiest option as it has support for consuming REST e.g.

http://blogs.msdn.com/pedram/archive/2008/04/21/how-to-consume-rest-services-with-wcf.aspx


keef
mcqueene

Posted: Mar 09, 2009
Score: 0 Reference
If this were for work or I had a web host then creating a wrapper web service would be the way to go. Getting a host just for this is more than I care to invest right now.
phlegias

Posted: Mar 16, 2009
Score: 0 Reference
ahem,

having had experience with both SOAP web services and REST web services i would recommend you to AVOID completely anything SOAP related.

REST is direct, easy to implement, interoperable and all the good things.
SOAP is horrible, cumbersome, NOT interoperable and all the bad things.

This is, of course, a personal opinion. :P

Now seriously, implementing a REST webservice client is just sending HTTP GETS and getting their replies, parse a simple xml and you're done, i wouldn't mess with coding wrappers for soap.
Sytone

Posted: Mar 24, 2009
Score: 0 Reference
The WCF Rest implimentation assumes that you are using Get, Post, Delete and Update as methods. Which from what I can see this api does not use. Also you should be able to pass a xml block in the rest call but all the values are on the param string.

I am about 20% way through a API which will be able to be used in WPF with the property notify avaliable. I am using it as a learning experience for Generics and WPF as I have not had a chance to play with either.
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.