web service show localhost not IP in SOAP - web-services

I created a web service named WildflyTest and a method called HelloWorld and deployed it to my wildfly 11 server,the server ip is 10.10.9.151.I tried to test using SoapUI, and I can open the wsdl address http://10.10.9.151:8086/WildflyTest/HelloWorld?wsdl. But when I tested it in SOAP Ui, when I created a new request, the address is http://localhost:8086/WildflyTest instead of 10.10.9.151.Can anyone give me some suggestion where to check the reason? Thx.

The issue is with your bind address. By default, public interface is configured to listen on the loopback address of 127.0.0.1. So if you start WildFly as: ./bin/standalone.sh
Then the WildFly default page can be accessed as http://127.0.0.1:8080. Usually, /etc/hosts provide a mapping of 127.0.0.1 to localhost, and so the same page is accessible at http://localhost:8080. 8080 is the HTTP port where all applications are accessed.
On a multihomed machine, you may like to start WildFly and bind public interface to a specific IP address. This can be easily done as:
./bin/standalone.sh -b=10.10.9.151 //your server ip
Now the applications can be accessed at http://10.10.9.151:8080.
Refer following links for more info:
Bind WildFly to a different IP address
How to configure JBoss to bind to a different IP ?

Related

Can server host different domain in same port?

I am trying to understand how to host different apps in server, so can server host different domain in same port.
For example, I have domain1 and domain2 both hosted at port 443. Can this be done?
I am doing this in IIS server.
A single web IIS server can host different domain in same port. However, in order IIS to distribute HTTP requests correctly, each website has to be identified with some unique value. In case of an IIS website, it consists of three attributes that make up a unique combination for each website. These are:
a TCP port number
an IP address
a host header (host name)
The information about the hosted websites is stored in the ServerBindings attribute of the IIS metabase in the following format: IP:Port:Hostname. Thus, if you want to host multiple websites on the same port and IP address, you will have to use a unique Host header. What is it? Host header is a part of an HTTP request to the server sent by a client that specifies which website it is addressed to. Accordingly, this host header must be specified on the side of the web server, and the DNS contains the correct record that matches the hostname and the IP address of the IIS web server.
Let’s suppose that you have a website running on IIS and listening 443 port. And you need to bind second website to the same port. In the IIS Manager, create another website with the name TestSite, which files will be located in c:\inetpub\TestSite (do not specify the hostname yet). After you click OK, a warning appears that you cannot use the binding *:443 for both sites.
The binding '*:443:' is assigned to another site. If you assign the same binding to this site, you will only be able to start one of the sites. Are you sure that you want to add this duplicate binding?
Agree to this warning. So you have got another site bound to port 443, you cannot start it without stopping the first site.

Get public client IP in a Flask App?

I want to log the public WAN IP of a client trying to authenticate on a Flask application.
Actually, any method I tried return me the LAN IP of the client.
My stack is an Apache 2.2 server using mod_wsgi to serve the Flask application.
Methods I tried :
request.remote_addr
request.access_route # The list contain only one value which is the LAN IP
request.environ['REMOTE_ADDR']
How could I get the public IP ?
Thanks for any help.
EDIT uniqueness:
I have no proxy set and don't have the "X-Forwarded-For" header.
I don't get a "127.0.0.1" but the LAN IP of the client.
For exemple, for the moment my LAN IP is "10.192.132.148" and my colleague LAN IP could be "10.192.132.149", but our public WAN IP is for both "193.xxx.xxx.xxx".
I'm looking for a way to get this last one in my Flask application.
Ok, finally I got the explication ... the test server was visible only via a connection through a VPN network, so the server was seeing my computer directly just like if it was on my LAN.

access mule http endpoint deployed in tomcat

I have developed a SOAP webservice in mule, which has the endpoint configured as say
for e.g.
http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:7001/helloService"
doc:name="HTTP"
It is deployed as a WAR file in tomcat server. Am able to access the wsdl from my local desktop like this - endpoint?wsdl and works perfectly fine.
How can I access this when deployed in a remote server? What endpoint should it be given? Can it contain localhost and port as it is?
Do I need to refer the context path of the web app? Its a little bit confusing...Can someone help pls?
You're binding to localhost so it'll only work on the machine it's running. You can bind to all interfaces using 0.0.0.0 and the access it remotely using the machine's IP address or domain name.

publish jax-ws service on public ip

I've a simple jax-ws web service that on localhost works fine with the clients, but now I want to publish the web service on a public ip, so the clients can interact with it through wan network instead lan network.
I signed to no-ip dns service provider and defined my host like "myname.no-ip.info".
In my code i start the service in this way:
Endpoint.publish("http://localhost:8080/baseStationProvider", new BaseStationProvider());
and the browser at http://myname.no-ip.info:8080/baseStationProvider#wsdl doesn't show the wsdl.
If i start the service in this way:
Endpoint.publish("http://myname.no-ip.info/baseStationProvider", new BaseStationProvider());
compiling the code, it raise this exception:
Server Runtime Error: java.net.SocketException: Unresolved address
Any idea to problem and/or how to do what i need?
thanks in advance
This seems likely to do with routing and firewalls as opposed to web service publication etc. Ignoring the web-service aspect, can you even reach your server when you use this in your browser:
http://myname.no-ip.info:8080/
?
Which should look the same as
http://localhost:8080/
If not, then it is probably DNS/Routing/Firewalls that you need to check. Diagnostics that will help there are:
1) can the machine you are testing on resolve the DNS name mynam.no-ip.info? nslookup, ping, traceroute/tracert
2) is there a firewall blocking port 8080 from reaching local host? If the route from the internet to your host hits a firewall (which it will) that firewall will have to forward the request.
Good luck.

Testing a remote web service with soapUI

I have a Javax web service deployed in a remote Linux machine within a JBoss ESB container. I am able to test the web service using soapUI on the same machine as where the service is deployed. The WDSL URI I used was something like http://127.0.0.1:8080/abcd/abcd?wsdl.
What I would like to do is to be able to test the same service from another machine using soapUI. I tried replacing 127.0.0.1 with the IP address of the machine where the service is deployed. This does not seem to work. Can someone tell me what I am missing here?
Thanks.
a sum of things could go wrong there - as already mentioned by the others the firewall is blocking access for the given (address, port) pair. Another thing that happened to me was that the WSDL was generated using the name of the machine it was deployed on and whenever I was trying to call the service from a different machine it was complaining that I cannot find the given machine.
You need to test network connectively. One tool you can use is plain old telnet. If you telnet to the ip/port combo of the web server, you will get a response (an HTTP error). For example:
$ telnet 192.168.0.10 8080
If you get nothing then there is almost certainly a firewall blocking access.
If you are convinced that no firewall is blocking you, the other possibility is that the web server is only bound to the local network adapter (127.0.0.1) and not the other network adapters (ethernet/wifi). This is very unlikely however.