Deploy local glassfish restfull service to the internet - java

I succesfully created an restfull webservice with netbeans and glassfish.
If I test the service locally (on localhost) i can POST, PUT, DELETE, and so on...
I also have my own domain on the internet...I pay for it every month.
It seems like a simple job but for some reason I can't find the solution to deploy my restfull webservice to that domain.
Like if I enter the URL of my domain with specific URL info that I would get an JSON respond.
I googled around...but it seems I'm looking at the wrong places.
So...
1) How can I deploy my local restful service to my domain online
2) is it possible trough netbeans and glassfish ?
3) Will I have to use an external application ?
thanx in advance

Related

How to deploy webService and get access to wsdl?

I have got a webService without ui. It simple jax-ws app that will allow to manage users via soap requests. I tried to deploy it on websphere. It was deployed, But! my app doesn't appear in Service Providers and i can't get access to wsdl file via url that i pass in wsdlsoap:aderess location. It haven't got any servlets and other stuff. I create my app using template that deploy with success, it appear in Service Providers. I research all internet, but idk what go wrong.
P.S: Template project was eclipse project. I just add maven and has no idea why it wouldn't work.
The fact that your web service hasn't appeared in the Service Providers section means you've deployed it the wrong way.
Check whether you've selected the "Deploy web-services" option during deployment.
You probably got an issue in your trace.log file which possibly references to the ffdc, check it to investigate the problem.
You also haven't mentioned if you using servlet or EJB-based web services.

How to deploy Spring framework backend and Angular 2 frontend application in any online server?

Please correct if the way I am doing is wrong.
In my web application I am not using jsp pages for developing user interface. Instead I am using html, css and Angular 2 and front-end project structure is separated from back-end.
Although I am able to develop a simple project using Angular CLI which is served by SpringMVC back-end. Front-end is using port 4200 and backend is running on port 8080. I have managed to take and serve request from Angular 2 to SpringMVC. In local mode these are working perfectly, now I want to make them host on a live server.
How to publish SpringMVC back-end and Angular 2 front-end separately but running on same domain? I am not using SpringBoot also front-end and back-end are in separate folders. I do not want to combine both in same project structure and generate a war file and deploy.
What is the best practice for developing SpringMVC back-end and Angular-2 back-end and deploying them in online server?
What I've found works best is running nginx as a static file server and a forward proxy for the spring app.
usually I use the angular-cli proxy to make /api/ go to http://localhost:8080
that means that calls to http://localhost:3000/api/** get passed to http://localhost:8080/api/. And since you are on the same domain we can simply call /api/

Deploying the google translation api in my java server locally and not invoking web service.

I want to deploy the google translation api in my java server locally. Is there any option where we can get the translation result either from any jar or something else instead of invoking the web service. Since, data which i need to translate is secure and it cannot be exposed. Could you please provide me the information on deploying the same on application server and not invoking web services.
Google Translation API works great with web service call, but i need something which can be done locally not via web service.
Or is there any other API which i can use for the same.
There is no jar that you can install and run it locally. You have to call Google Web Services.

Testing that cxf sample project java_first_spring_support works

Basic question.
I've compiled and deployed to a local tomcat the war file that gets created in the sample cxf project java_first_spring_support (I followed the tutorial given here but using latest versions from cxf site : http://cxf.apache.org/docs/writing-a-service-with-spring.html ) but can't figure out how to test if it's working? my tomcat manager list apps page says it's running but not sure what to do beyond that.
Can I hit it with a http request via the browser to see the wsdl? If so what url should I use beyond my 'http://localhost:8080' url?
Is there no wsdl with this project and I should just craft my own soap request? and if so what should the structure be and what url should I use?
Well, figured it out. Went back to web.xml 101 and found my answer.
The generated wsdl is available from :-
http://localhost:8080/JavaFirstSpringSupport/services/HelloWorld?wsdl
Context of the app was : 'JavaFirstSpringSupport' (got this from my apps list page in tomcat) Got the services part by refering to the url pattern element in the deployed web.xml

Make web service work on different server

I am developing a web service with Eclipse. This service will be accessed from Android with ksoap2.
I successfully tested the service on my local apache tomcat (http://localhost:8080/) and now want to set this service up on a different server (i.e. http://giraffe/).
The .wsdl file generated by Eclipse contains the following line:
<wsdlsoap:address location="http://localhost:8080/AndroidService/services/AndroidService"/>
I guess this won't work out if I just add the .war file to giraffe and try to reach the service.
My question now is the following: What do I need to change in order to be able to use this service on a different server? Do I just have to change this address location?
If you need me to post some of the code/files, just tell me.
My eclipse project structure looks like this:
You can replace http://localhost:8080 on wsdl with http://giraffe/
Are you facing any issue once you deploy on the server?

Categories