How to implement asynchronous request response in REST based web service

I have a REST based web service system. I need to find a way to support publish/subscribe model here. As you know REST the communication between client and server is HTTP protocol. I use apache (PHP) web server in the backend to server all REST requests. The question is how to use PHP or whatever (in the web server side) to support this kind of Pub/Sub model. One typical scenario would be:

1) Client subscribes for a change in an object (GET /config/object/?type=async) 2) Client does not block with this request as it is async call. 3) Server accept the subscription and waits for the event. 4) Server publishes the client with the required data as and when the event happens.

I basically need to know how to implement all of these four steps above.

-------------Problems Reply------------

You are probably looking for something like PubSubHubbub -

http://code.google.com/apis/pubsubhubbub/

Letting PubSub implement the hub for you means you don't need blocking calls to the server.

They already have implemented example Subscribers and Publishers in different languages.

If haven't already, you should read Roy Fielding's take on the various approaches to PubSub. http://roy.gbiv.com/untangled/2008/paper-tigers-and-hidden-dragons

Category:web services Views:0 Time:2010-08-17

Related post

  • log request/response of .net SOAP web service 2010-10-05

    I'm consuming a third party .NET SOAP WebService (.asmx). I want to log request and response. I have seen some solutions using SoapExtensions. But I like to integrate logging in my system, some like this: public class MyWebService : ThirdPartyWebServ

  • How to generate customized XML response in Java based web service? 2011-10-11

    I want to create web service in java using Netbeans 7. I have two entities Product and Category both annotated with JAXB annotations. I have created EJBs using these entity classes and web service productservice using these EJBs. On og the method in

  • What is the best way to implement REST based Web Services in .NET? 2009-05-12

    So far my options are ADO.Net data services, WCF REST Starter Kit(not sure if I can use it, as their EULA is hard to comprehend and confusing), ASP.NET MVC. There are quite a few posts, but I want to see if there are anymore frameworks that I am miss

  • What is the best way to implement group/batch execution within a single web services call? 2011-01-28

    What is the best way to implement group/batch execution within a single web services call? I have a service that I need to load a bunch of individual records to be processed. I'd like a tightly coupled interface if possible so that the XSD can valida

  • How to hide HTML code in response status in REST web service 2011-04-01

    I am new to REST web service. Do anyone know how to hide or remove the HTML code in response status in REST web service? Now in HTTP response I got the response status + HTML code. Is it because of Error or Exception ? thanks

  • How to get the Request object in an EJB based Web Service 2011-07-13

    Unlike JAX-WS web services, I couldn't get the SOAP request object in an EJB based Web Services, by the way, I am using Oracle Application Server. Thanks. --------------Solutions------------- Use @Resource to inject WebServiceContext into the EJB.

  • What is the best way to implement a request/response protocol using akka and scala? 2011-06-09

    I've been studying about how I could develop a distributed architecture that implements the protocol request/response using the concept of concurrency through actors. I concluded that the best way to do this is by creating a response system with sync

  • How can I implement a request-response protocol without blocking while awaiting response? 2011-10-22

    I need to implement an application that is simultaneously communicating with multiple clients using a (bidirectional) request-response protocol. Previously I have implemented this using two dedicated threads for each client (one reader/reactor and on

  • Logging requests/responses in a WCF REST service 2009-10-31

    I'm looking for a way to log both requests and responses in a WCF REST service. The WCF REST starter kit comes with a RequestInterceptor class which can be used to intercept requests, but there does not seem to be an equivalent for responses. Ideally

  • "The request failed with an empty response" when calling a web service 2011-12-27

    While calling a webservice hosted in a server from an aspx page am getting the error like "The request failed with an empty response". code in my page try { HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create("https://login.erp.com/rodeprovis

  • Multithreaded test to test response time of sites/web services 2014-12-04

    Below code tests the response time of reading www.google.com into a BufferedReader. I plan on using this code to test the response times of other sites and web services within intranet. Below tests runs for 20 seconds and opens 4 requests per second

  • Ksoap on android- get a list response from a java web service 2010-12-11

    I have a java web service (soap) which i want to use with an android client for that am using ksoap. My web service gives an answer which look like this : <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:l

  • soapclient request from php to c# web service with authentication 2011-02-09

    I want to execute remote function by using php soap.The web service is created by using c# .net.There must be authentication in order to call remote function.I always get unauthorized error whenever i tried to call remote function.However,when i get

  • Using a request/reply with an NService web service bridge 2011-05-26

    The NServiceBus Web service bridge example only demonstrates a Command message scenario. I am interested in a scenario where the web service bridge uses request/reply to do a synchronous response to the client like any other normal web service call.

  • Asynchronous script component in SSIS for web service call 2011-06-05

    I have to create a SSIS package for the following scenario. First, I have to do a database query . A set of Ids is returned from the query. For each Id , I have to do a web service call which will further call some wcf services sequentially. The set

  • 404 response when calling external web service from amazon ec2 2011-06-22

    When I call an external web service from Amazon EC2 server I get a 404 response for the request. When I call the same web service locally it works fine. Can anyone tell me why this happens? --------------Solutions------------- It is entirely possible

  • Parsing Xml response from third party web service 2012-02-08

    I have installed cURB library for my rails 2 application and I am able to send multiple xml files to a single url of a web service as a post request. In addition to that I receive an receipt from the web service in an xml file which I need to be pars

  • Collect xml response by third party web service 2012-02-08

    I have used this command to send xml files to a web service named SRA-ENA. submission_field = Curl::PostField.content(File.read("xml/#{@experiment.alias}.submission.xml"), 'SUBMISSION') study_field = Curl::PostField.content(File.read("xml/#{@experime

  • How to get/debug request message when calling a Web Service 2012-04-16

    I have an application that calls a Https web service (as it seems created with java, not sure though). I get an error as response: "Error on verifying message against security policy Error code:1000" Now I don't exactly understand the error code and

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.093 (s). 11 q(s)