i need one answer. I am calling Asynchronous web services and ofcourse it want Asynchronous response. Must webservice somehow call my client or how is implemented response.
I read this and many other pages but i do not know if web service need to call me back for response.
http://www.mastertheboss.com/web-interfaces/111-asynchronous-web-services-with-jboss-ws.html
regards
You need to think it as a 3rd party service which you dont have any access to its source.
You need to handle asyn calls yourself for your side.
java.util.concurrent package contains what you want
see below link
http://www.scribd.com/doc/17369778/Java-Concurrent-Package-tutorial
Related
I am writing an android app in java, and would like to intercept all HTTP traffic from its outgoing requests and change the user agent from the header. I know there are tools to do this from separate apps/programs like Charles' Proxy, but can I do this from within the app itself? Would I be able to register a service in my app for this? If so, do you have any links I can reference to get started or have any tips? I am a novice coder, so anything at all is appreciated. Thank you.
Do you use OkHttp to make requests? If so, the library has a powerful mechanism of interceptors to do exactly what you want.
First of all I know i need to write service that does not depend on each other but i have to cause of some requirements from the client.
So now the problem is I have no idea how to request the data from one service to another service, I have 2 services lets call service1 and middlewareService, so the middleware service gets the details from some third party api, and the middleware is not linked to the database. so now I need to call a function in the middleware and get the details from service1 so that I can put save in the database and send it back to our application users.
I understand that this can be done through feginClients but I have no Idea on how to do it? can anybody help?
Thank you for your assistance, ;)
IT is fine i figured out how to achieve this using fegin client, thank you stackoverflow.
I would like to know how to set a timeout for a REST web service with Jersey, and being able to catch it within the service. I've read some approaches to achieve this, such as calling another service after the timeout to check if the current service is active, or verifying application credentials, etc.
I'd rather not to follow these approaches. In fact, I would like to know if is possible to set a listener to the HTTP request, or to the service itself, that would execute some procedure if
the timeout is reached.
I suppose that creating a thread within the service body to act as listener could be a solution, but I'd like to know if there is a solution closer to Jersey.
I'm pretty sure that Jersey like many other api's has client timeout functionality built in.
Don't want to give you loads of code so you can check out these posts
Not sure I remember correctly but I think you can set it using this clint api through setReadTimeout and setConnectTimeout*
https://jersey.java.net/apidocs/1.1.1-ea/jersey/com/sun/jersey/api/client/Client.html
could you please give me a sample code on how an Http Server(Java) receives the request of a client(android)? I mean the client sends the request via Httppost, how the server takes the content of these requests in order to see the context and reply? I am trying to built a chat application.
Thank you in advance!
The server-side of HTTP is usually implemented using the protocol stack provided by a web container. You would then implement your application's server-side as servlets. There are numerous tutorials on this.
If that's the way you want to proceed, look at one of the standard web containers; e.g. Tomcat, Jetty, Glassfish, etc. The source code for all of these is available for you to browse, though I should warn you that they are all complicated under the hood.
Assuming that your HTTP service is going to be delivering JSON or XML (rather than HTML) to clients, you may want to look into using a RESTful framework.
Have a look at ServerSocket. Keep in mind that accept() blocks and, as you will probably run it in a service, you will want to time it out and check for the completion of the service. That should probably run in its own thread as should the responders to requests.
From there, you can open input and output streams to receive the request and write the response. There are any number of packages that can help you with the interaction, or you can roll your own, but it doesn't seem like you've done a lot of homework. Perhaps some searching, reading, and more specific questions would more you along more quickly.
I am new to SKYPE.
I am wondering that can we call SKYPE API directly from URL?
I found a thread asking something like that.
Can you retrieve your Skype status using JSONP?
Facebook, twitter,etc provide their API expose to developers to make direct call from app.
Is it possible to make direct API call in SKYPE?
thanks.
Grace,
I would suggest you to make a RESTFul Web Service and use the Skype API on the server side.
You can easily expose all the Skype Services by exposing the different URLs.
JAX-RS using JAXB annotation will help you use JSON based communication between your browser and Web Service.
Hope it might help you.