I am trying to learn webservice building/deployment. I have built a webservice and deployed it on a oracle weblogic server on my laptop.
i am trying to test the webservice using soapUI from another laptop. i am getting invalid URL error.
can some one point out where i am going wrong
Note the same wsdl works fine if i try to run it from SoapUI on my laptop
Laptops have to be on same network. If so, each laptop will have its local Ip address ( go to cmd promt if using windows and type ipconfig).
Using this Ip, you can access webservice from second laptop which is hosted on your laptop.
If they are not on same network, it is possible but there are lots of things to be considered. I would suggest that only for production applications, not for testing.
Related
I have created an (AWS) Amazon web service server to run some Application created in Java, this app takes some port for example 8888 and runs locally in localhost:8888/index.html.
I can check that localhost:8888/index.html is working perfectly with the command:
curl localhost:8888/index.html
The thing is I don't know how to access to this app from my domain name, I know there is a way to do this using nginx, but unfortunately, all tutorials are about Node.js.
Following this article I managed to run a Node.JS app (simple app that prints hello world) running on localhost:8080, and when I access my domain name I could get the Hello world message printed!, my question is, can I do the same with a Java Application?
One best bet is to get the host ip and use it; instead of using localhost which sometimes mapped to 127.0.0.1, in such situation you can connect to the app within the host but not from outside.
Can you share the VM details?
I have a spring boot application (Spring Web) which has a tomcat server embedded into it (maven dependency). The application is a server and consists of several HTTP routes. This application is on my laptop. I would like to execute the application on my laptop, and be able to RESTful calls (e.g. GET, POST etc) to the server. How can I make requests to the server from my computer?
I've checked out several tutorials and they tend to use XAMP or another similar application so not sure on how to go about this. Thank you.
Once your war is deployed on your server, you can send any REST call to it using curl, a browser, or my personal favorite for testing is Postman as it circumvents cross-domain issues.
To make the REST call simply use the IP address of the server instead of localhost. You can get the IP address of the machine using ifconfig or whatsmyip.org
http://<IP address>/...
Follwing the steps as outlined here: Standalone web service
I created a test web service that works great on my local machine. Since this is 'stand alone' I copied the same root folder on to a 'server' that I use and published the service on the server (as if it is my local machine). When I access the wsdl using localhost as the domain name, it works fine on the server. However, when I try the url from a different macihne on the network giving the server's domain name instead of localhost, I get a 'can not be displayed' error in IE.
My question is, should this even be possible? Or is there anything specific that needs to be done. Since this is a 'stand alone' solution, we should not require 'another' container like tomcat correct?
To be honest, until your post, I had no idea there was a builtin, lightweight, HTTP Server in the JDK. I've always used glassfish for my web service needs.
I can't say for sure, but if you look closely at the example code you'll see:
Endpoint endpoint = Endpoint.publish("http://localhost:8080/calculator", calculator);
I suspect that this limits you to "localhost" as opposed to the host machine. Try changing it so that it represents the name of the server and try again from another machine (naturally making sure it can get through the firewall as well). Something like:
Endpoint endpoint = Endpoint.publish("http://myserver:8080/calculator", calculator);
Rebuild it and try again. Other than that, you'd need to create a proper war file and deploy to glassfish, tomcat, etc.
At the moment i have an android client app which connects to my java server through socket - serversocket. It sends and receive strings. The java server is connected to a mysql database (actually mariadb) using the jdbc driver.
I succeed to create a jbossas application and upload the code of the java server to openshift, but i didn't find any detailed tutorial on how do i connect to this new uploaded server from my socket client (This one (RMI or socket connection to Java Program on OpenShift) gives some tips but i'm still stucked).
More on this, how do i know that my server runs just fine on openshift and how do i control de calls to the database after i connect it (found this: $ rhc app create MyApp jbossas-7
$ rhc cartridge add mysql-5.5 -a MyApp), using org.mariadb.jdbc.Driver and java.sql is still working ?
Any small guide or tip is highly appreciated. I'm new to these things so please don't be too heavy on comments.
You can only make connections to your OpenShift server on http/https or ws/wss ports. If you want to connect to your java application and pull data from it from an android device, I would suggest using a RESTful api or a servlet, etc.
I had similar problem: My app server originally was running as a ServerSocket listener, and any clients/devices connect to it directly via Socket binding.
To deploy it into OpenShift, my previous initial solution was to change its host:port configuration by following the suggestion as described in this link [Socket connection to Java Program on OpenShift]. It worked nice as far as my app server was successfully up and running. But it did not work well with the port forwarding approach in order to accept remote requests.
So for the final solution, I modified the app server by wrapping my original code with a RESTful webservice around it, and deploy it as a web service.
I have deployed a webservice on my local jboss server which runs on port 9090. So my webservice url will be http://localhost:9090/app/Services/blah. I have written a mobile client code(for blackberry) which connects to this url to get the data. Initially the client code when run on a bb simulator threw HTTP 403 error. Found that addressing urls as localhost won't work on a bb simulator ( on a simualtor localhost refers to the MDS? ).
So I tried accessing the local jboss server using http://127.0.0.1:9090 , http://machinename:9090/, http://ipaddress:9090 and nothing works. All these urls throw HTTP 501(Service unavailable) which is weird. Can someone tell me what is wrong with this and what is the correct way to access the server?
http://machinename:9090/, http://ipaddress:9090 -> These urls are not even working when i try directly on a desktop browser. FYI, its a windows machine. Do I have to change any nw settings on my machine.?
chedine,
I am not good at bb. But, can you please ensure that your App Server is up & running? Can you access the JMX-Console screen of JBoss in your desktop browser - ie. http://a.b.c.d:9090/jmx-console or something similar. Only if the app server is up, we can dig further into this issue. Please let us know the result.