Why would I want to use web services for my plugin?

Why would I want to use web services for my plugin?

by Mike Churchward -
Number of replies: 1
Picture of Core developers Picture of Plugin developers Picture of Testers

I'm struggling trying to add mobile functionality to my questionnaire plugin. One of the key understanding issues I have is understanding why I would need web services instead of just using the "mobile" class and methods.

The "core-site-plugins-new-content" directive allows me to call my "mobile" methods direct. This would seem to be the correct way to deal with my module which can contain many pages of forms. I am currently having problems with the "useOtherData" argument, but I believe this can be resolved (I hope). Assuming I can get that argument to work, and all of my form data can be passed into the class method, this should be all I need.

But, if I can't get that to work, then I may need to use one of the "core-site-plugins-call-ws". But I am unclear on why I would need to do this. And if I have to use it, how do I do something with the data returned from the service? I need to be able to process the data that was returned from the form, and then potentially react to incorrect data. This can be returned in a structure from the service, but to where? I don't see any way to act on the return values.

Any help?

Average of ratings: -
In reply to Mike Churchward

Re: Why would I want to use web services for my plugin?

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Elevating the discussion and providing more information...
The reason I am asking this is using a web service means creating more data management code. If I have written my plugin appropriately, I should already have working data management code separated from the display code. Ideally for my mobile integration, I should only need to call the existing data management code, with perhaps some pre-processing code to reformat the items that come from the mobile app, and the redirect the output to the mobile app output template code.
So what am I missing by not using the web services?