I'm doing performance testing for mobile application which is developed in java language and
coming to load runner scripting i'm using java over HTTP as protocol.
Actually i'm not aware of this protocol,i can able to record the application but i don't know whether all the requests got captured or not.
Note:In java over HTTP protocol no generation log and no run time viewer to validate the requests .So how can we validate?
Please share your experience on this protocol and get me out of this issue.
This appears to be a cross post with several posts on facebook. If these other posts are yours then please pick one thread as reference for answers
ShotgunPostsAreSPAM
Related
I want to accomplish this:
https://developers.google.com/games/services/web/serverlogin
with Java instead of javascript. I know the APIs exist for Java, as I already have a desktop application and an Android application that are able to login properly to Google, using Java APIs. Now I just need to figure out how to follow the process described above with regular Java.
This line is particularly annoying:
"If the auth object in my google-signin-callback already has an access token, can I send that to the server instead of performing this additional code-exchange step?
A: No. You should avoid sending access tokens to your server if at all possible. The "exchange a single-use code for an access token" strategy is much more secure and we highly recommend using that approach in your applications."
I have seen things that seem to contradict in several places, including on Google's guides. This seems like it would be the easiest way given what I have working, but I'd do it properly if I could figure out how in Java. I want to be able to access Google Play Games Services on the client side as well as the server side.
1) How do I get a single use token on the client side? (on android and desktop)
2) How do I exchange it on the server side?
Thanks
I've been looking around all morning, and can't seem to figure this one out. I know it's not as complicated as I think it is, and all I need is just some pointers to the right direction.
I have an Android application that takes some user input, sends it to a Java application over the web, and then receives some output based on the input.
My Android and Java applications are ready, but how do I go about sending and receiving the data over the web? I understand that I'll be sending and receiving HTTP requests, but my problem is where I'll be sending them and receiving them from. Do I host my Java application on a Servlet like Tomcat, or do I use something like OpenShift to host my application for me?
I have no trouble with sending some HTTP request from my Android application to the web and receiving some output back, but my problem is that my web service needs to use a Java library to process the input and generate the output. I'm just not sure how I'm supposed to get this data to and from this Java library that needs to be hosted on the web.
I hope my question makes any sense.
EDIT: Perhaps I wasn't clear with what exactly I need help with. I do realize that the architecture I use doesn't really make any difference, but the problem I have is with how I'm supposed to use this architecture.
Let's say I have a registered domain name that I can easily send to and receive data from using my Android application - no trouble with that. But how am I supposed to integrate my Java library with this server? Do I just create an applet and put it on my server? Does my web host even allow Java applets to run?
I guess my question is how I'm supposed to get through the "barrier" between my HTTP request / transport layer protocol and my Java application.
Server architecture usually does not matter. You can use Java, NodeJs, Rails, Python, .NET, etc. You just need an endpoint that accepts a HTTP POST/PUT/GET/DELETE/PATCH verb.
This is more a question of "how do I set up a server to accept input" and its a very large topic in itself. I would advise you look at PAAS solutions like:
Parse.com
Kinvey.com
You can use their tools to build a solution fairly quickly. If you need something custom you'll need to build your backend in the language of choice and host it online via AWS, Google Cloud, Heroku, a VPS or something similar.
I have a website that is a companion app for a java application. Namely, the web app fetches information from the java app and inputs it into my database and lets the user access this information. Right now I have the system set up so the Java app posts to the website's php files when I tell the Java app to.
However, I am wanting to set the system up so that the java app posts to the website when a command is issued from the website, such as a refresh command. Is this possible?
This is extremely vague. You should not think of the problem in terms of "posting from PHP to Java", in fact every HTTP request is simply that - an HTTP request. PHP and Java both offer several ways to respond to HTTP requests. It's up to you to compose the scripts that will respond to each request. Think of this in terms of the requests you need to make and the responses they should receive, then focus on writing a script for each of those interactions.
You can call Java directly from PHP. Zend Server and PHP/Java bridge both enable this. Depending on your requirements one of those may be appropriate.
Alternatively you can make use of message oriented middleware. This requires you to install and run a message broker such as RabbitMQ or ActiveMQ. However client libraries are available for much more than just PHP and Java.
Both of these would be better alternatives than relying on HTTP requests.
I am writing an iOS 5.1.1 app for the iPad2 using Xcode 4.4.1. I want to be able to locate a local http server running on Java.
Once I am able to connect to the http server, all I need to communicate with it is the url including the port.
My questions:
1) Should I use Bonjour or a DNS Server running on the http server to discover the http server itself?
2) I need to authenticate the iPad2 user with name and password to work with the http server once I discover it.
I need some help understanding how I would go about accomplishing these two steps including source code if available for the iOS 5 and Xcode 4.4.1.
1) Bonjour is pretty easy to tie in with Java apps. If you're particularly masochistic you can write your own Java-based mDNS (Bonjour) responders (I've done it, it's not rocket science), but the quickest way to get going is to use jMDNS in your http server to advertise its existence. I won't copy & paste the code samples but they suffice for most applications.
On the iOS side, NSNetService is your friend. Fundamentally it involves starting a responder in the background to look for services (i.e. your Java app), then calling a delegate when something appears/disappears:
id delegateObject; // Assume this exists.
NSNetServiceBrowser *serviceBrowser;
serviceBrowser = [[NSNetServiceBrowser alloc] init];
[serviceBrowser setDelegate:delegateObject];
[serviceBrowser searchForServicesOfType:#"_http._tcp" inDomain:#""];
There's a guide that explains it all. The protocol hasn't changed for 10+ years and you count on all modern iOS/OS X versions supporting it. The jMDNS library is pretty well battle-tested at this stage, too.
You might consider creating your own service type if you don't want it to be visible to other apps that search for _http._tcp., although this is just a cosmetic thing.
2) The simplest thing that'd work would be HTTP basic auth; you didn't say what kind of authentication your app supports or how you make HTTP requests on the client side, but this is pretty well covered already.
I am currently trying to transfer a file from a Android device to a Java TCP Server, but I am unable to find a good example which explains the structure I would need to implement this. There are many Java Client&Server examples there which explain file transfer but I want to make sure if this will still work once one throws an Android Device in there.
My question is how do I implement this sort of structure? And if it doesn't work, would I be better sending the file over an HTTP connection to a PHP server? I see a lot of examples and documentation online for the later method so I presume it is more reliable. I would however prefer to use a Java server.
The file consists of a large set of coordinates recorded by the Android device which will then be sent to the server. I have not yet established how I will store this data yet but I was originally going to store them in a primitive text file.
Design
The first thing you need is something to allow you to run Java code on your server.
There are a number of options. Two of the most popular technologies are Glassfish and Apache Tomcat.
Crudely speaking Apache Tomcat is sufficient for simple client-server communication and Glassfish is used if you need to do more complex stuff. Both allow Servlets (which are essentially self contained server classes written in Java) to run on the server-side.
They handle communication with the client by launching a JVM (Java Virtual Machine) each time they receive a request. The Java servlet can run inside the JVM and respond do some processing if required before sending a response back to the client.Each new request is run in a new instance of a servlet. This makes dealing with multiple concurrent requests simpler (no need for more complex threading).
Networking (sending data to and from the server)
In networking situations the client can be a PC, an Android phone, or any other device capable of connecting to the internet. As far as the server is concerned, if the client can communicate using HTTP (a standard protocol which it understands) the it doesn't care what sort of device it is. This means that solutions for PC desktop client-server applications are similar to one for a phone.
You can use library such as Apache HTTP Components to make it easier to handle HTTP requests and responses between the device and the server. Of course you could write your own classes to do this using Sockets but this would be very time consuming, particularly if you have never done it before.
Storage of Data
If you have time I would recommend implementing some sort of database to store the information.
They have a number of benefits to such as data recovery mechanisms, indexing for fast searching of data, ensure data integrity, better structuring of data and so on.
If you decide to use a database I recommend MySQL. It is a free and more importantly - well documented.
Aside: JDBC can be used to communicate with the database with Java.
Sorry about the in-line hyperlinks - apparently my repuation isn't high enough to post more than two!
Source: Personal experience from implementing a similar design.