I wrote a web service in java with using jersey framework that using my apache tika wrapper. That wrapper wraps tika-app-1.7.jar. My question what is the best way: wrap tika-app-1.7.jar or tika-server-1.7.jar or it doesn't matter?
The Tika build consists of a number of components and produces the following main binaries:
tika-core/target/tika-core-*.jar
Tika core library. Contains the core interfaces and classes of Tika, but none of the parser implementations. Depends only on Java 6.
tika-parsers/target/tika-parsers-*.jar
Tika parsers. Collection of classes that implement the Tika Parser interface based on various external parser libraries.
tika-app/target/tika-app-*.jar
Tika application. Combines the above components and all the external parser libraries into a single runnable jar with a GUI and a command line interface.
tika-server/target/tika-server-*.jar
Tika JAX-RS REST application. This is a Jetty web server running Tika REST services as described in this page.
tika-bundle/target/tika-bundle-*.jar
Tika bundle. An OSGi bundle that combines tika-parsers with non-OSGified parser libraries to make them easy to deploy in an OSGi environment.
Tika app is runnable ie.
You can pass commmand line parameters and get the results.
However Tika server runs as http server where you can send and receive http request/response.
Both uses tika core classes to do the job.
If you are writing a wrapper it doesn't matter as the server/commandline code simply never executed.
Related
I want to generate a simple java class from this WSDL url:
https://xyz.pqr.com/Portal/Service.svc?wsdl
How can I do this? I am looking for a tool which can generate the code.
You can use Apache Axis.
It comes with a tool i.e. WSDL2Java converter.
using below command.
wsdl2java.bat -uri [URL of WSDL file] (on Windows)
or
wsdl2java.sh -uri [URL of WSDL file] on Linux
Through this you can generate the Stub classes from WSDL.
For me the best tool for generating java classes for my WCF web service is
http://easywsdl.com/
It uses ksoap2 library and supports complex types (with inheritance), data in attributes, header values and WCF extensions like Guid data type and data contract with IsReference attribute.
Some examples over here might help you: Apache CXF project
Or just use the JDK documentation, from 1.6 on the JDK includes JAX-WS functionality as standard, including the tools to generate client stubs from WSDL using wsimport.
I am new to Web services. I need to invoke a web service whose definition is in http://api.search.live.net/search.wsdl . I need to do a search of any keyword by using this web service.
I search on the net but could not find any solution. Any idea how to invoke the web service. I need to use Java.
Download axis2.
After extracting it, under the bin folder there is a tool called wsdl2java, this is used to generate stubs from the WSDL that can communicate with the webservice.
A sample usage would be:
WSDL2Java -uri http://api.search.live.net/search.wsdl -d xmlbeans -s
look here for more details on that tool.
Besides stubs it will also generate all the objects you need.
Here is a tutorial using axis2 and Eclipse IDE.
I use intelliJ to generate the java code I need from a WSDL. You can then use this code to do SOAP calls.
Give it the WSDL and it will generate the code, some info can be found here:
http://www.jetbrains.com/idea/webhelp/generating-wsdl-document-from-java-code.html
Take a look at http://ws.apache.org/ where you will find Axis2 which is probably what you are looking for.
Note that web-services are more generic term than WSDL and have evolved since WSDL was introduced to the point that most services today speak JSON and alike. See more here RESTEasy or Jersey?
I have a GWT webapp, and there are various tables showing in the pages.
I need to have a mechanism put in the webapp to convert the tables through XML/XSLT files into PDF files.
I researched for PDF file converters and I found the following libraries:
apache's FOP
iText
But I am getting errors in implementing them. Does GWT support them?
[ERROR] [myGWTProject] - Line 842: No source code is available for type org.apache.fop.apps.FopFactory; did you forget to inherit a required module?
My webapp relies on GWT concerning both parts the client side and the server side.
Any help is appreciated.
In all likelyhood, no. GWT only supports a very limited set of JRE features. Unless they specifically designed the library to integrate it with GWT, it will not work.
To use such libraries, usually, you delegate that to your server, you do the job and when ready you return it to the client.
I would just like to ask if there is a way to upload files in GWT WITHOUT using the Google App Engine and Apache Commons archives? I've been searching for ways to upload files in GWT but all of the solutions I find all make use of these two. I would just like to know if there is a way, because our app won't work if we use GAE and Apache Commons... Thank you very much!
Yes, the simplest would be (assuming you are saving files to Blobstore):
On GWT side use FileUpload. Here is an example on how to use it.
On GAE side use BlobStore upload handler.
The other option would be to use gwt-upload with GAE upload handler.
GWT does not have such feature. You need to use some existing library or handle multipart form submits by yourself (FileUpload class). There is for example a gwtupload library which I have used and it worked pretty fine (but it is based on commons-upload AFAIR). There are other libs for sure.
http://code.google.com/p/gwtupload/
For those that don't know, Processing is a great Java library =for rendering nice visualizations of data and serves as a wrapper for JOGL.
Processing.js is the Javascript port of this library.
In order to create a processing applet inside HTML, you need 3 things.
processing.js
anything.html
anything.pde // Processing program
I'm basically trying out the js version and the problem is that if any libraries are included in the pde, it won't load inside the canvas.
Here are 2 examples:
This is an example that spawns some basic shapes with no libraries required.
This is an example that uses the handy fisica library. If I try it in the same format as this then it will not load.
I have 2 hypotheses:
There is some configuration that must be done before using any libraries in processing.js.
All libraries for Processing are put in the default library folder \Processing\modes\java. This is obviously not being reached by the HTML file so perhaps there is another way to add the files into the application?
Unfortunately, Processing.js does not support Processing libraries. This because they are compiled Java bytecode, not Java source code. For physics, you could use Box2D.js. See a tutorial on processingjs.org. For more information on the limitations of Processing.js as compared to Processing, see our P5 quick start guide.