Converting War to .exe / Testing Restful Webservice - java

I am a newbie to this Rest Web Services.
This question is already posted. But I cannot understand a thing. I have two questions here.
When we created a WebApp with soap web services, we generated a test client to test it. Is there a way we can test Rest Webservices? (Using Eclipse IDE, Generated test client in the following way.
File---> new---> other---> web service---> web service client. So, now how can i test Restful web services? (I found one Rest Client tool, but I dont understand how to use that (Newbie :) ).
I need to find a way to give our war file to client as .exe file. I didn't understand what exactly that meant, but here is the requirement.
"We need to give our client this in the form of .exe file, like whenever we download some .exe file, it will ask us to Run, Accept license, Browse destination, and such things. And also he shouldn't be able to see our code."
This is what exactly our senior management told me and Is there a way we can make it possible??
(I showed him the InstallJammer and then he said the client shouldn't see the code.)

For Question 2:
See some packaging tool like NSIS or IzPack or InnoSetup

Related

Given a JAR file, allegedly contains web server, how do I deploy it?

I've been handed a JAR file, told it contains a web application, and instructed to deploy it. I'm familiar with java as a language, but I have next to no experience with its web ecosystem. Trying to run it as an executable, I find out it has no main class, so I take a look at the contents, and find that it has a META-INF/web-fragment.xml file, along with a couple of Servlet classes and some config files referenced in the xml. It looks like there is basically everything here for a complete application, but I have no idea how to actually deploy it, and google only yields tutorials on how to build these things from scratch with IDEs and deploy using maven plugins and goals.
Assuming that building from source is out of the question and I only have standard unix and java CLI tools available, based on the information provided (And I can provide more if necessary), what is the simplest way to get this up and running?
A web applicaton should be in a WAR file, not a JAR file, and you should only need to just drop it into the webapp directory of your Tomcat, or follow the instructions for whatever other container you're using.
If it's only a fragment, as appears from the XML, (a) it isn't a webapp, only part of one, and (b) you personally can't deploy it at all. You need the whole thing.
Send the assignment back for clarification.

How to set up a system that reads PMML files which I create using R?

For the past few days I'm stuck at trying to pass a PMML file with .xml extension that I created using R and pmml package. After creating a iris.xml PMML file I have no where to go, actually I don't know what to look for. And then I saw Alex Guazzelli's video here, where he tells us to use ADAPA from Zementis to run the PMML files that are created from R.
What I took away from the video is,
I want to do something similar as shown, like uploading my PMML file at some place and input my test files frequently to get the corresponding predicted values.
ADAPA looks great, but looks like it also costs some money. So I would like to look for an alternative, which might not be as user friendly as ADAPA.
Then I found this page where the author says,
So the first step was to get the engine running. I experienced some small problems but Scott fixed them very fast and offered a new war file ready for deployment inside tomcat. It can be obtained under http://code.google.com/p/openscoring/. If you still encounter some problems you could also try my war file. It was built with java version “1.6.0_26” and tested under tomcat 7. After installing the war file using the management console, you could test it by sending a POST request in XML like the following to ‘http://localhost:8080/OpenScoring/Scoring’
Then I found jpmml. The problem here is the package names are very confusing, I don't know which one to install. In fact I don't know how to install each of them. I have basic knowledge of Java, apparently it isn't helpful in the current scenario.
Desperately looking forward for any kind of help.
How do the data flows in your application look like? Zementis' ADAPA is a standalone web service, which lets you do scoring in a request/response fashion. This works for web applications, but is clearly sub-optimal if you're looking to score larger amounts of data.
The JPMML project provides "PMML runtimes" for most popular big data frameworks. For example, if your application is tied to Apache Spark, then you would go for the JPMML-Spark project, if tied to Apache Hive/Pig, then for the JPMML-Pig project, etc. For a simple REST web service you should check out the Openscoring project, which is functionally identical to Zementis' ADAPA.
All JPMML projects can be built from their source checkout using Apache Maven by issuing the following command:
mvn clean install
Some JPMML projects also have their binaries distributed via the Maven Central repository. If you're looking for the Openscoring WAR file, then you need to search for "openscoring-webapp" and on the results page click the "download WAR" link (at the time of writing this, you would get openscoring-webapp-1.2.12.war). This is a standard WAR file that can be dropped to the auto deploy folder of your favourite Java web server (Tomcat?) as it is. The REST API of the web service is fully documented in the README file of the Openscoring project.

Webservices :Understanding the task assigned

I am a complete newbie to web services and I am working alone. My lead mailed me a task to complete. I think he has hard coded the information and he wants me to replace the hard coded data from web services.
He has mailed me a WSDL file and said
Make the jar file from the wsdl.
What does this mean ?
There are tools which will generate Java code to talk to web services, performing serialization and deserialization effectively, so that your client code can talk in terms of Java objects rather than raw SOAP.
You should find out which of these tools is being used in your project, and apply it to the WSDL provided.
(Also, it's a good idea to get used to asking for more information when you don't understand the assignment. A good team leader - or anyone, really - should be more than happy to help you.)
Generate the Java stubs from the wsdl.
wsdl2Java
wsdl2Java
If you are familiar with eclipse, then the task can be completed easily. I think he is asking for the jar of client stub which can be produced from the wsdl.
In that case do: In eclipse, make sure you have webservices plugin. Follow this after that
You will have few .java files being exported. Try to compile them and generate the .class files. Now jar the .class files using command in command prompt
jar -cvf <Name of the jar>.jar *

From Matlab to the web

I have big project in Matlab with some pretty complicated GUI. I'd like to put it on my apache server. The idea is: people should've access to it without downloading anything (I mean something like Java applet or web app). I've managed to create a .jar file by using the deploytool but I'm not sure it's the right way. I've read mathworks tutorial, but in the example: http://www.mathworks.com/help/toolbox/javabuilder/ug/bsqrikz-26.html they're using some piece of JavaCode which I don't really know where they got it from. In the end I've created a .war file but the apache sees it only as an archive, not as an application, so clearly I did something wrong.
So, could someone tell what I have to do step-by-step to create a web application from my Matlab code, please?
Thx!
There are a number of webinars by MathWorks showing how. Here is the most recent one I could find:
Application Deployment with MATLAB
For reference, there is a page listing all the options for deploying MATLAB on the web.

How to convert EAR as executable file?

I have no idea about converting EAR file into exe(Executable file), Where are i am working with jboss and i developing webservices. I want to give my product as executable file . Can anybody has idea about this.
Thank you
Gobi, you've already posted a question regarding this on 15th March, to which you've got no response. I guess you've just rephrased that same question here.
Might I suggest asking your customer/client how she would like the web service 'ear' delivered? I'm also guessing you might have database scripts, properties/config files etc. I'd put my money on 'a zip containing the ear, database scripts (if any) with related documentation'
There is no way a customer would want to 'double click' your ear and have it installed directly onto a server. If you read your Java EE spec correctly, you'd find a 'deployer' role in there. Its not there for fun. Its a very serious role whose responsibilities include 'configuring' your application.
Think about it.
You mean you want customers/users/whatever to just be able to double-click on your file, and there's a web server up and running? While that would be possible, it's not really the way most people want to run web services. They're very likely to want to run your web service within an existing container, configuring it alongside other services.
An EAR file is already designed to be pretty much droppable within a container, so that's fine. You could also supply a zip file (or an installer) with a sample container setup using any of the free container implementations - either preconfigured with some reasonable default values (e.g. for the port) or running through an installer wizard. I wouldn't spend too much time on it though - I'd assume that most people who want to run a web service will already have some experience of setting up a container, or will have specific requirements you couldn't easily capture in a wizard without a lot of work.
I don't know about making EAR as executable.
There is a editor which converts your project into setup file or installer for windows .
Hope this helps.
I used NSIS editor and recommend it and it only creates installer for windows.
HM NSIS Editor.
you may also have look at izpack

Categories