This is a discussion and working group for anyone interested in the Services module and related modules. This module was created out of a need for a standardized solution of integrating external applications with Drupal, specifically Flash and Flex applications. Visit the issues page for all bug reports. Also visit the Services Handbook for information and examples.
How throw server side exceptions and handle them on the client?
Hi,
I'm new to Drupal, so please bare with me.
I'm creating a service mobile.whoAmI() that is to return a name of the logged in user.
The code is simple:
function mobile_service_who_am_i() {
global $user;
if (!$user->uid) {
// User is not logged in
return services_error(t('User is not logged in.'), 406);
} else {
$result = new stdClass();
$result->sessid = session_id();
$result->user = $user->name ;
return $result;
}
}
I have JSON-RPC server installed.
Read moreJSON Request Stop Working on Production Server
Update:
Ends up the issue was connected with the hosting provider upgrading to PHP 5.2.14 as there were updates done to json_decode which made the way I was passing in my arguments on PHP 5.1.6 fine but in the latest version of PHP would return null. Updated the data argument to be
data: {method: '"car_service.get_product_listing"', tids: '"' + selectedTid + '"'}, (This item in JSON issue queue says to use the double quotes around arguments because json_decode expects them, http://drupal.org/node/884708)
Hey All,
Read moreFringefest.ca - iphone, web app & open data case study
I recently posted a case study on our competition entry FringeFest.ca, for the Apps4Edmonton competition that made use of Drupal, Appcelerator Titanium and Mobile Webkit to create a web app, iphone app and smartphone friendly version of the web app using Open Data made available by the City of Edmonton.
Key modules include: Services, Feeds, JSON Server, Views, Location and more detailed in the case study
Read moreServices Questions and Opportunities
Hello,
I need a little advice and maybe some help.
Here are the requirements:
- I have a media encoding server that needs to send a video file to the Drupal server and create a node.
- I need to provide a sample request that is formatted to push file into Drupal and create a node.
This is going to be for a project released on DO that relies on the services module.
What do you think the issues will be with this?
What is the file struct that has to be provided in JSON format to fill out the field:
struct file (required)
An object representing a file
Subscribing to specific content type by taxonomy term/tag OR Vocabulary
Hi,
I am wondering if Service module can assist with getting the Notifications module to allow users to subscribe to specific content types by taxonomy terms/vocabulary. i.e. Content Type - workshops AND Taxonomy Term - life drawing.... OR Content Type - workshops AND Vocabulary - Art. What is needed is to tie the subscribed content type to a taxomony term/vocabulary to focus the search. A person may subscribe to multiple content types under the same terms.
Thanks in advance!
Read morewhitespaces in XMLRPC response
Recently i am having a problem with the XMLRPC service. I am getting empty white spaces before the actual xml response. I have debugged and checked, all the response coming from the xmlrpc service is coming fine. But for some reason the final response that i get in my java client has empty spaces and hence the parsing fails on the client side. The prob wasnt initially there. It came up after after i made some changes but i have no clue what. Could someone tell me on how i can get to the root of the problem. As of now i know there is no problem with the services modules.
Read moreHowto resolve related data in output (not just IDs) for views?
PLEASE HELP: When calling a complex recordset from Flex or in the Service Browser of drupal I always get the foreign key of the related objects - but not the object data itself. In many cases that makes sense (lazy loading etc.). But for simple data exchange it might be easier to simply get a complex generic object with arrays that holds ALL the data, so my Flex client doesn't need to know about the actual data structure. HOW? (see screenshots)
Read moregroovy xml-rpc + Services
I'm trying to do some node creation via groovy. Via the XML-RPC groovy module and the Drupal Services module, my groovy code looks like, and results in, this:
groovy:000> def server = new XMLRPCServerProxy("http://localhost/drupal/?q=services/xmlrpc")
ERROR groovy.net.xmlrpc.XMLRPCCallFailureException:
XML-RPC call Failure: fault string = "Empty response from server", fault code = 0
at java_lang_Runnable$run.call (Unknown Source)
'tis a little frustrating not being able to get past the first line of code, but haven't gotten much help from the intertubes.
Read moreJSONP Server with key authentication
I'm building an iPhone app using JQTouch/JQuery and PhoneGap, and so I was hoping the services module would allow me to pull content via javascript into my iPhone application from Drupal. In theory.
It took me all day to figure out why my calls weren't working with the normal JSON server...because it's cross-domain. Ugh.
So now I'm going to focus on JSONP, which should solve THAT problem. But I can't really find a clear explanation of how to do anything with key authentication in javascript. Or would key authentication even be necessary here? I do want it as secure as possible.
Read moreWorking Example with Services 3.x User.Login and System.Connect
Has anybody a working user.login example with services 3.x and user.login?
I downloaded the latest repository from this git hub
http://github.com/randallknutson/services
and get the node creation for anonymous user working.
But i cant using the user login method oder system connect. I activate the session authentication , because i think oauth is more complex.
my urls are
i tried with Firefox REST Client Extension and php curl test example:
HTTP-METHOD: POST
url: http:///user/login <- yes the blank page comes!
Content-Type: application/json
PUT vs POST
REST Server module maps POST to Create and PUT to Update:
Create: POST /services/rest/node + body data
Retrieve: GET /services/rest/node/123
Update: PUT /services/rest/node/123 + body data
Delete: DELETE /services/rest/node/123
My reading of material such as RESTful Web Services (O'Reilly) is that PUT should be used for resource creation (where the client knows the URL for the resource).
Is there a way of achieving that mapping in REST Server 2.x?
Read moreWhat did heyrocker say about the servers in services 3
I was listening to the presentation by heyrocker. He said that there's a plan to update or re-write the REST server and move it into services core.
1) Can we expect the same thing for the amfphp server by the amfphp module, and other servers as well?
2) Does that mean we won't need to download each server individually and add it into the servers folder with the xmlrpc folder? because that would be awesome.
Read moreabout to release DrupalProxy an as3/drupal proxy, what to do?
Hey all,
I am about to release on our blog our DrupalProxy flash/flex as3 class under the MIT license provided by our company's open source package that enables you to talk with your drupal backend via the amf services via a flash or flex client.
It is the replacement of our highly successful DrupalService implementation (which you can read about here: http://www.dpdk.nl/opensource/drupalservice-as-a-bridge-between-flash-an...)
Read moreBasic example of retrieving a node from a Drupal server using JSON/JQuery?
This might be a dumb question but are there any usable examples of retrieving a node's content and title from a Drupal server using JSON in Javascript? I've scoured Google and Drupal but nothing pops up that is usable. Any quick pointers appreciated. Thanks
Read morexmlrpclib.Fault: <Fault 1: 'Missing required arguments.'>
I'm trying to write a Python XMLRPC client to talk to a Drupal site. So far I can anonymously connect and get a list of commands, but as soon as I try to login, I get:
xmlrpclib.Fault:
My code so far:
#!/usr/bin/python
import xmlrpclib
key='blahblah'
server = xmlrpclib.ServerProxy("http://localhost/community/services/xmlrpc")
connection = server.system.connect(key)
session = server.user.login(connection['sessid'], 'username', 'password')
print server.system.listMethods()
print server.node.get(89, [])Help us potential contributors to help you maintainers
I have made attempts to patch Services 6.x-2.2:
http://drupal.org/node/806856 (cant see what's wrong here)
http://drupal.org/node/807638 (can see why this is receiving resistance)
http://drupal.org/node/806918 (uhm...)
I have also forked and downloaded 6.x-3.x via git and the GitHub (struggling a bit with those two - but I'll get there).
Had a look at the relevant handbook http://drupal.org/node/736522 and issue queue http://drupal.org/project/issues/services?text=&status=Open&priorities=A...
Can services module be used to create a "Content API"?
I'm having trouble wrapping my head around services. I was hoping a post here might yield some fruit. I have an interest in creating a "Content API" for my site--so that other people could submit custom queries to my drupal db and have something like a JSON object returned to them with the resulting content in it.
Read moreServices + AMFPHP second node returns false
I have installed services + AMFPHP and views to use drupal content in my Flash website.
Everything works perfectly. The view gets the right nodes and AMFPHP sends the object to flash.
However, my 'news' view returns the two news nodes I created perfectly in Drupal (services -> views.get as well as the live preview on the views page).
In Flash, I only get the first node, and the second node returns only 'false'.
What could be the problem??
iPhone XML-RPC Services "Missing Required Arguments"
I'm writing an iPhone app that accesses my Drupal 6 Services remotely.
I'm using the Cocoa XML-RPC Framework and no matter how I send the arguments to my Drupal site, it returns with "Missing Required Arguments" Fault Error.
I'm using sessions and not keys, and the system.connect method works perfectly and gives me a session Id. But when I try and run any other method that uses arguments it faults...
Read morenode.save with XMLRPC call to other Drupal site. “Access Denied” message
One drupal site to create a node on another drupal site in a multi-site setup. It looks like I'm getting the sessionid and logging in just fine, but when trying to create a "page" node, I get "Access denied". Under Services -> Settings, I have "Key Authentication", "Use keys" is unchecked, and "Use sessid" is checked.
I gave permissions for the logged in user: "create page content", "administer services", etc... I'm running Services 6.x-2.2 and XMLRPC Server 6.x-2.2
Below is my code:
<? $url = 'http://drupal2.dev/xmlrpc.php'; ?>
<?



