I have a client server setup. I need my client to be able to call the server, and the server pass down either a file or the text contained in the file. I am new to web development. Which type of technologies should I investigate. I know that Java Web Services, Java Servlets, Java EE Applications all exist. But which one would be best for my uses? The server side application must be Java and run in Apache Tomcat.
Any suggestions would be greatly appreciated.
Thanks
Check out the Google Web Toolkit
Try Restlet in combination with Jetty container, but it works with any container (including Tomcat). Here is where you can start.
Restlet can be used for both desktop or in-browser web apps. Also it nicely integrates with Google Web Toolkit.
Related
I am new to Web service, and have a JavaFX desktop application running client-side.
I am planning to create an Android application that will call the web service exposed by the desktop application. Any suggestions on how to do this? Tutorial links would be helpful.
I know you are new to webservices, but please go through some documentations first ! You may find a nice tutorial here
A short introduction to Web Services
Just to give you a brief idea on what is wrong with your question. Javafx Desktop application and an android application are both basically clients (who consume web servcies).
You need to have a Server (who exposes web services) hosting a web application, so that these clients can use it. Your webapplication build in java, php, asp etc. The language doesn't matter in case of webservices !
I am a newbie to C# development.
Scenario -
We have an application running on .NET 2.0 framework and IIS 6.5. Now, we have installed another application on a remote server which utilizes Jetty web server. For us to integrate both the applications we need to add a reference to a web service in jetty. I have found the web service path on the server which is a .class file and I want to add a reference to my .NET application.
My problem is - how do I find the URL to add a web reference to the .NET application in Visual Studio ? or is there another way to integrate both the applications ?
Thanks
Have you tried using the .wsdl of the .NET web service to generate a proxy class in the Jetty web server? I am assuming there is some type of discovery mechanism built into the Jetty web server for web service capabilities, right?
I am currently developing an application for some researchers in my university.It's a small java program that you can use by command line. The next step is to package that program and deploy it to an application server. Some clients program will submit requests to the server who will call the tool that I wrote. Lately, we will add more tools to the server and he has to dispatch the requests to the right tool.
Which application server fits my needs ? I have looked for Tomcat, Jetty and Glassfish but it seems that they are only used for web application.
Is it possible to use those servers in some context different from web context? Which package archive should i use (jar, war) ?
Any advice?
Some clients program will submit requests to the server who will call the tool that I wrote.
The big question is what server-side technology and what communication protocol can you use between the clients and the server. You basically have two major options: HTTP and web services (in that case, consider using either JAX-WS or JAX-RS) or RMI-IIOP and EJBs (in that case, you'll have to use a Java EE compliant server like GlassFish).
I have looked for Tomcat, Jetty and Glassfish but it seems that they are only used for web application.
Not really. As I said, they can also be used for web services oriented applications. And GlassFish can be used for EJBs applications.
Which package archive should i use (jar, war)
The packaging will depend on the type of application you'll write, it's not something that you choose upfront, it's just a consequence. EJBs are packaged in an EJB JAR and typically deployed inside an EAR; Servlet based web services are deployed inside a WAR.
You really need to think about what technology to use first (with the current level of detail, I can't provide more guidance).
Do you even need an application server? There's nothing stopping you from adding the necessary network bindings and deploying it on its own.
Of the servers you mention, you've got 2 different categories: servlet containers and full-stack Java EE servers
Tomcat and Jetty are servlet containers. That doesn't mean that you can only do web stuff with them and you could manually add the required libraries to get a full Java EE server.
Glassfish is a full-stack Java EE server and can be compared with JBoss (both are open source) or the commercial rivals Weblogic and Websphere.
Sometimes this question is simple as the environment you are working in mandates a particular flavour of app server. You should check this first.
If you're not forced to use an app server, I'd ask why you think you need to use an app server?
I don't see why you would want to use tomcat, glassfish or jetty for a command line program.
If it's command-line based, and you want it to run server-side, you could write a little program that allows users to, for instance, telnet to your server, which in turn starts the CLI-application in question, and relays input / output to the client.
You may also want to look into Java Webstart, which makes deployment of new versions a breeze.
Actually we can't answer with so few elements.
- What are you planning to do
- With what technologies
- Where are you planning to host your application (have you got budget?)
- In which language are written the clients (even the future ones)?
- Could clients be on mobile phones (add some technlogy constraints...)
....
It would also be great to know what kind of request the clients will do, and what kind of response the server will provide...
Actually with what you tell us, all those application servers can do what you want...
I have looked for Tomcat, Jetty and
Glassfish but it seems that they are
only used for web application
You could even make a webapplication (servlet) and on the clientside use a httpclient to call that servlet... there are so many options :)
vive Paris!
I'm tasked with creating a Java Web Service for a .NET 2.0 client to consume.
What would your suggestions for the implementation be?
The solution doesn't need to be very heavyweight (don't need a full Java EE container I believe) but what do you think is the best solution for this? I have thought about using Glassfish v2 with JAX-WS annotations (#WebService), and JAXB XML Bindings(e.g. #XmlElement), which I assume the .NET client would be able to consume?
Has anyone tried this scenario?
Would Glassfish be overkill though, since I'm merely using the Web Service as a mechanism for .NET on Windows to communicate to the Linux box, the underlying application is extremely small.
Any suggestions are more than welcome :)
Thanks,
James
P.S. Other notes - would you use Axis/CXF instead of Glassfish? Would you use a servlet container such as Tomcat? etc.
I have used Axis2 and it works.
I had the same problem of making Data Exposing API (Web Service in my case) in Java.
I made the web service using Axis2 and Spring (to access database) and the WSDL created via Axis2 was easily consumed via ASP.NET Application via its Add Web Service Dialog Box and the corresponding Proxy Classes were created easily.
I've a small doubt in my mind; could anyone please clarify me is the Tomcat web server or Web container?
It's both a web server (supports HTTP protocol) and a web container (supports JSP/Servlet API, also called "servlet container" at times).
As mentioned above, Tomcat is both a web server and a web container, but it's not really meant to function as a high performance web server, nor does it include some features typical of a web server. Tomcat is meant to be used in conjunction with the Apache web server, where Apache manages static pages, caching, redirection, etc. and Tomcat handles the container (web application) functions. You'll often hear the phrase "Apache Tomcat" together, which is both a proper attribution of the Tomcat project (as part of the Apache Foundation), but also appropriate as a label, as they're usually used together as a package.
If you don't have an high performance server requirements and/or want to embed a relatively simple web server with container functionality, Tomcat is fine for that (and probably the easiest embedded web container to work with, comparable with Jetty). Interestingly, the Catalina class used as the main Tomcat engine is actually a subclass of the Embedded class that can be used in a standalone web application.
A web server is any program that accepts incoming HTTP connections.