Web Service / Forms: Architecture and Framework Question - java

We have the following architecture in mind:
To an existing application, we would like to add a web service front end.
The web service will be used from a web portal, which runs on a different web server.
So, we will not use a database on this different web server and just forward entries from the web portal to the web service and show what the web service returns.
First question: what do you think about this architecture?
Second question: Can you recommend a java framework for this web server?

On the second question: one possibility is to use WSRP with Java Portlets.

Related

Java Web Service - Has it to be in a new project?

As you can see, I'm really starting learning about Web Services and, in all examples I've seen, a new Web Project is created to implement the Web Service.
In my case, I already have a Web Application implemented and I need a WS to an Android app for this application. So, my question is: can I create the WS in this project or do I have to make a new project for that?
Any help will be apreciated, thanks.
Can I create the WS in this project or do I have to make a new project for that?
It depends on your design. Any web application can be the producer of the web services, so yes, you can use your current web application to host the services. But, there will be more requests to your application since there are new clients apart from internet browsers, so if your application is prepared to handle lots of requests, then do it. IMO it should be a different web application since they have different purposes, even if they use the same business services and data access layers, so if your main web application is undeployed for maintainability purposes, then your web application that hosts the services can be still up and running smoothly.

how to create 2 java web services (wars) in a single web application in netbeans

Please help me in creating a single java web application in netbeans 7 that consists of two java web services (wars). For example one service is web services that serves front end user directly by communicating with another service like database services. Two services should be deployable with a single build.xml so that front end developer or client feels as if there is only one services.

Application architecture - how to connect Swing app to backend?

We are developing a java application which provide web services through SSL. This application is running in Tomcat server.
The purpose of web services is insert, update and select data. So under web service tier is implemented backend tier, which provide access to database.
Suddenly we were asked to build swing application which will also access the data in database. We want to use the same backend (exactly the same runtime) which is used for web service application. How to reach this goal?
I see following possibilities:
use web app instead swing application, which will be part of the same project like web service application and then it will be able to connect backend
Provide some extra web services for swing application only.
Use JMX. It is possible run JMX on Tomcat. Backend could provide functionality through JMX and Swing application could connect it.
Each of these possibilities have advantages and disadvantages. We followed solution 3 and I think it wasn't a clever selection. JMX has problem with generics, you can run only one JMX on tomcat etc.
Java world is rich and there should be some optimal solution for this situation. Could you help?
Add a web service client to the Swing app and let it make exactly the same calls to web services that a browser based UI would.
You're certainly free to add extra, Swing-only web services if you choose.
I didn't think JMX was anything other than a way to allow you to monitor MBeans using a JConsole. What does that have to do with Swing?

Client architecture for calling Spring based web service

I have written a SOAP based web service which runs fine on a Tomcat server. The Web Service service itself is a Spring MVC based web service that runs on the Tomcat application server.
Now i need to write a Thick client which will be a standalone Java app that will use the services of the web service. I think i am correct in that the client only needs to know about the service details (i.e. operations) and nothing else.
What i am not sure of is the architecture and environment i should use for the client. The client application will be based on Swing but is it possible to use Spring with Swing together?
On the web service i have the following setup
view --> Service --> Model
The client application is basically a configuration tool. It uses the web service to configure user accounts. This means that the client application does not actually write anything to any database. It just uses the services of the web service to make changes to 'user account' and probably view list of accounts.
My question really is
- Is an MVC design suitable for such a use case
- Usually Spring is used for web based applications. Is there any benefit in using Spring with the Swing based client?
- Are there any alternative or better solutions/design/architecture that would achieve the same?
An example showing Spring used in conjunction with a Swing application would be very usefull.
Thanks in advance.
Spring MVC is not appropriate for a Swing-based client. Use the core Spring framework and a JAX-RS implementation like Jersey to provide simple REST web services in tomcat. Jersey also provides a corresponding client API that you can use within your Swing application to invoke the REST services.
If you have decided upon Swing as your platform, there are two options you can look at:
(1) Net Beans Rich Client Platform
http://netbeans.org/kb/trails/platform.html
(2) You can roll up your sleeves and write your own app using a low level yet extremely flexible framework called Swixml
http://www.swixml.org/
Give Swixml a good try before you try others, it may surprise you.
You can implement Swing-based thin client application with Spring Integration backend serving as a integration tier. It can expose gateways accepting simple Java types or DTOs. Your Swing presenters / controllers interacts with these components in order to call remote webservices.

asp.net with java backend

I currently have a full java web application stack (J2EE web app using Spring and Hibernate with a RIA client using dojo).
I have to move technology stacks for the UI to be asp.net but am allowed to keep the server components in java.
Any ideas on best practice here - and yes, I have to adopt this hybrid tech stack.
Initial thoughts are:
asp.net ajax (possibly using asp.net MVC) to provide the UI and a thin control layer in IIS.
expose current java web app (residing on a remote machine) as RESTful web services (the web app would remain in a J2EE serlet container such as Tomcat or Jetty). The new control layer would provide security (authentication and authorisation), comet server push abilities and then basic request passthrough to the web app.
Basically, I am unsure 'how much' C# I should write in the control layer and how best to expose and communicate with the existing java web app. Also, currently, I use JSON as the data interchange format.
I would suggest you start moving to asp.net feature by feature, don't try to implement everything at once.

Categories

Resources