How to deploy a web service to amazon EC2? - java

i've just created a web application and deployed it to Amazon EC2 , but now i want to create a java web service and deploy it to instance in Amazon AWS to be able to use it in my Application

There are many possible configurations. This can be one of them:
Start the application server (probably tomcat) with AJP enabled.
Use the apache HTTP server JK module to connect the webserver to the Tomcat application.
Deploy your web application on the application server and make it generate the WSDL using the external domain name or ip. For example: http://www.domain.com/application/service
Make sure that the Amazon firewall has the port 80 open for that instance.
If you use domain name, make your DNS point to that host.

Related

Can I deploy Java web service and SQL database in different host server?

I have deployed my database in one server and my Java web service in another server.
I tried to access the database with web service but it doesn't return any rows.
Can I deploy database and Java web service in different servers?
can i deploy database and java web service in different server?
Yes you can, database and web-server are not dependent on each other installation. Just make sure you have the connectivity between the two machines, firewall allows connection on the desired port.

publishing and hosting the webservice on cloud

I have web service that is up and running that is in other words it is publish on my tomat on port 8080 and I can hit it through my browser now I want that my webservice to be get published on cloud so that I can pass wsdl uri to any one in the world and he can access my wsdl. Please advise how to achieve this ..!!will Amazon provide such facilities.
I've tried various options and Amazon's Elastic Beanstalk is the most seamless. You can launch your Java webservice by simply uploading a war. However, it does require an EC2 instance to be running.
Other options are Heroku and Windows Azure
Heroku has a free tier and uses Maven/Git to deploy the app to their server. https://devcenter.heroku.com/articles/deploy-a-java-web-application-that-launches-with-jetty-runner
Windows Azure also has instructions on how to deploy a java webapp on their platform. http://www.windowsazure.com/en-us/develop/java/
Given these options, In my personal opinion, the cheapest is Heroku and the most convinient is Amazon Elastic Beanstalk.

glassfish load balancer configuration

I am trying to configure clustering in glassfish 3.1.1 server. I have made clusters but it deploys application on different port number and different ip i want it shold be handled by the load balancer and application should be run on the ip of loadbalancer only that means if a machine is down the loadbalancer redirects that request on another machine configured in loadbalancer.
How to achieve it? does any one have idea about it? or provide link of tutorial and/or blogs for the same.
http://tiainen.sertik.net/2011/03/load-balancing-with-glassfish-31-and.html
To brief up:
Steps to configure a glassfish cluster with a Load Balancer:
Create a cluster
Create instances for the cluster
Start the cluster
Deploy the web application
Create a network listener to listen the requests coming from the load balancer
Install Apache Web Server and get the mod_jk module
Edit the httpd.conf file and workers.properties file in the conf directory of apache web server
Restart the cluster, glassfish domain and apache daemon
Note: You might need to keep you firewall off if using any Linux OS.

How to deploy web service on two different system within a LAN?

I have created a web service using Netbeans in Fedora which is working fine in local host. But I want to deploy client on different computer and server on different computer.
I could also connect two Fedora systems using a LAN cable(SSH), but could not access the web service.
What is the procedure to deploy it? Does a webDav-http service connection be established? If so how to do that?
To deploy your project in a different machine, compile it, and the copy the war file to the application server you desire. I use Tomcat, just need to copy the war to the webapp folder, you should have something like in glassfish.
About the clients:
What are you using to generate the client? I assume metro, since is the default in netbeans.
Create a new java project;
Add new, Web Service Client;
Create it from the url: something like http://example.com.someService?wsdl.
Changing the ip you change the machine that this client will communicate to.

Java Web Services with GlassFish and Remote Connections

Currently I have a Windows 2008 R2 server. On this server I have installed Glassfish 3.1. On my server, I also have a copy of Netbeans installed. I use Netbeans to develop a web service. I can get Netbeans to deploy the web service I have created correctly to Glassfish, but it deploys on localhost. Do I need to modify Glassfish or Netbeans so that the web service is deployed on the public ip address for the server and not local host?
Thanks
Glassfish in the standard configuration binds to all network interfaces (i.e. responds on all IP-numbers the machine has).
Hence, if you have deployed it to Glassfish on a machine you should be able to access it with an URL pointing to any of the machines names or IP-numbers.

Categories