Notify server to client via Web service - web-services

I made a WebService chat. At the client side I am running a thread to check periodically if there any new messages available.
I want to know is there are any way to notify clients via Web Service.
I found something call 'Solicit Response' related to web service. But I am not aware how it works.
Any help is appreciated.
Thank you

In web services, the clients strictly request, they don't listen. What you need is some way for the server to "push" to the client. You're looking for something like Comet which isn't part of a web service per se.
Edit
Here's a relevant stackoverflow discussion.

Related

Can a wcf client handle 2 version of a SOAP response from the same url?

I imported a service reference to a SOAP web service from the customer and coded my client based on that.
After going to production, they said they will launch a new version of the web service with changes to the output type of one of the requests I make to the service (among new messages that I don't consume).
I know I can update my service reference and update my client code to process the updated wsdl and launch an update to my client at the same time the web service updates.
But, is it possible to instrument the WCF code in some way so that I can handle both versions of the response without having to coordinate the update of my client with the update of the web service?
In most cases, NO. It depends on what has changes in the service interface? In most cases you'll need (and want) to upgrade your client. You can always ask them to support more versions of their interfaces.

two ways communication in web services

How can I have two ways communication with WS. Two ways means a client could be a server and a server could be a client. As far as I understand the problem related to the client-server model in HTTP which is used by WS. What is the best practice for this scenario when a server wants send an event to multiple clients without being polled. ?
As far as I know there are some solutions but I do not know which one is best
1) server-push techniques (websockets)
2) SOAP over JMS (this sounds great)
3) WS-eventing
Thanks
The purpose of a webservice is - as the name says - to serve. It responds to requests, but it never sends requests on its own (but an application accessed through a webservice interface could send requests to other webservices to fulfill a request sent to it).
When a component of a service-oriented architecture is supposed to receive events from another component, it means that the receiving component has to act as a server and expose an own web services interface so that the component where the event occured can call it.

Forwarding web services through JMS

I'm trying to figure out how to forward web service requests from the web server to a remote application server through jms.
In my architecture there are web services client which communicate with some web server (Tomcat) which needs to forward the request to be executed on a remote application server and at the end get the result and push it back to the web service client.
Something like:
Web Service Client <-> HTTP <-> Tomcat <-> JMS <-> Application Server.
I want to use jax-ws so my methods will be called automatically in the application server.
Although I've expected this will be common approach, I didn't find any examples.
I would appreciate if someone can provide some links or tips on how such a configuration can be built.
Currently I'm using Metro but any other solution is valid as well.
Another aspect which I'm interested in, is whether I can use the fast-infoset over JMS to increase performance.
Thanks in advance,
Avner
you can try wso2MB as a JMS provider ...Check following links, would be useful
[1]http://wso2.org/library/message-broker
[2]http://pzf.fremantle.org/2011/04/introduction-to-wso2-message-broker_05.html
One option to solve it is using Apache Camel.
Then you can configure such a thing with an XML configuration file.

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.
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

Developing a secure WS client for consuming a Axis2 Web Service with Rampart WS Security module?

I have a Axis2 web service secured using Rampart. I do want to develop secure clients for it, preferably JAX-WS based. I tried a lot of tutorials but they are so closed tied with each other, like including Axis2 libraries in the client side. The client should be fairly independent of the WS service framework, as the service can be consumed by .NET based clients or even PHP based clients.
Thanks in advance...
As I understand it, you would want to be able to feed the policy defined for your Rampart secured web service into your JAX-WS client.
That ought to be doable. As you say-- the idea is to be able to execute different client and server technologies, standardized around WSDLs...
We're only just getting into this - so I don't have any hands on knowledge for you.
But I would think you should be able to copy the policy info for your rampart on the server in the services.xml file and put it in your client.
This seemed pretty helpful:
https://metro.dev.java.net/guide/
Sections 12 and 18 in particular.