Consume web services via LAN - web-services

I have web services running on my machine on a local network. Instead of connecting to them via localhost, I'd like to be able to connect to them via local IP - in this case 192.168.1.5. Once I can do this, I'll know other devices on the network can consume these web services too (in particular, my android phone).
In my project setup in Visual Studio 2013 (I am using IIS Express), if I set the project url to be http://testdomain.com:52252 and set the line in my hosts file for 192.168.1.5 testdomain.com, then connecting to testdomain.com:52252/testservices.asmx works just fine. However when I change the project url to http://192.168.1.5:52252/ and connect straight to 192.168.1.5:52252/testservices.asmx it returns Bad Request - Invalid Hostname. HTTP Error 400. The request hostname is invalid.
What is an effective way of testing web services on a local network? I need to develop and test web services and test them from an android device, but I am disallowed from developing/testing them on a live server at the moment. Are there any solutions to this?
I have looked for solutions online but have been unable to find any. I find it hard to believe there is not a common solution to this issue - surely people must have a way to test web services without hosting a server or connecting via localhost?.

I really see there being two routes to take
1) Route each domain to a vlan with it's own ip
Virtual LAN - https://en.wikipedia.org/wiki/Virtual_LAN
Configure VLANs in a Microsoft Windows Environment - http://docs.oracle.com/cd/E19407-01/820-7898-11/z40001c91004554.html
2) Create x number of virtual machines and simulate traffic

I've got it - I had heard others needing to turn off their firewall in order to get this to work. Personally I was using McAfee to manage my windows firewall - so I'd turned McAfee firewall off assuming that was enough - but I was wrong. Despite turning the firewall off, I still had to go into the advanced windows firewall settings and add an inbound rule to allow all incoming connections over the specified port. It then worked - I could call web services from other devices on the network!

The key is to edit the IIS Express file called applicationhost.config. Add a binding just like localhost, but with your IP address. Note that you have a binding configuration for each VS2012 project so put it in the one you are using.
Then right click IIS Express in the sytem tray and exit. Exit VS, then open it using Run As Administrator. That should do it.
<bindings>
<binding protocol="http" bindingInformation="*:24486:localhost" />
<binding protocol="http" bindingInformation="*:24486:192.168.4.104" />
</bindings>

Related

Not able to see test webpage remotely but can ping the server

I have a test server that I can ping successfully although I'm not able to see a hello world test page I've created and mapped in IIS. I've also created an Inbound rule in the windows firewall. Is there something else I'm missing? I'm browsing http://x.x.x.x:888
Any advice greatly appreciated.
Many thanks,
Update
This is a AWS server
Have tried telnet from a client machine but I get Operation timed out
Nothing in IIS logs (C:\inetpub\logs\LogFiles\xxx)
Port 888 is what I assign the test website to in IIS
Have also moved the test file (index.htm) into the default website within IIS and tried browsing http://x.x.x.x:80/index.htm but I get This site can’t be reached
browsing http://localhost on the server displays the 'hello' message test page.
In windows explorer I've gone to the security settings by right clicking on the website folder and allowing 'everyone' read access
Firewall screen shot
Important update
the IP http://x.x.x.x:888 is the public IP within AWS for the server, not the interal IP of that actual server
On windows 10, I found a firewall issue for my testing server, this worked for me: go to Windows Firewall -> Advanced Settings -> Windows Firewall properties and set a public profile to allow incoming connections.

How can i allow people in my local network to access the web service in my machine?

I have coded a web service using the Axis 2 framework and I can successfully invoke it using a test client (SoapUI) on the local machine after publishing the application in JBoss 5. I can post to the WS endpoint from the local machine and get the expected response.
Now i want to allow other machines to access the web service.
i changed the "localhost" to "my own fixed IP" adress at the end point location, and turned firewall off, but impossible to access the WS.
Note : windows Xp SP3.
Any idea ?
Thanks in advance !!
Please ensure you follow below steps
For example, if your ip is 10.132.243.54
List item
Checking if your IP is pingable by other systems
Instead of running with eclipse, run your jboss from your
command-prompt
start jboss-server suffixing -b in run.bat. The command is run.bat
-b 10.132.243.54
Access the WS from SOAP-UI using IP and not using localhost
If your IP is still not pingable, turn off the firewall, after
following above steps
Sorry for the late reply, However this would solve the problem i guess

CFHTTP firewall issue? How are CFHTTP requests made?

CFHTTP on my new CF 9 server is failing. I get back "408 Request Time-out" when attempting to connect to the test page on the server via its internal or external IP. I am not using SSL and using the standard port 80.
My old CF 9 server can connect to itself fine but it also fails if attempting to connect to the new server.
If I RDP into the server, I am able to pull up the same test page via a web browser or via telnet to that ip port 80.
I suspect that this is a firewall issue. I'd like to know how CF makes an HTTP request under the hood before I talk to the hosting team. What service is making the call? What port is it running under, etc.
You don't say what operating system you are running under, but if it is Windows, I'd take a look at the Windows Firewall settings on your new machine, and disable the firewall. That will allow you to check if indeed it is the Firewall in the way.
If that works you can then try and add a firewall exception for the application, i.e. JRun.
Hope that helps.

Windows Integrated Authentication fails ONLY if web svcs client is on same machine as IIS server

I have a web service running under IIS7 on a server with a host header set so that it receives requests made to http://myserver1.mydomain.com.
I've set Windows INtegrated Authentication to Enabled and everything else (basic, anonymous, etc) to Disabled.
I'm testing the web service using a powershell script, and it works fine when I run it from my workstation against http://myserver1.mydomain.com
However, when I run the same exact script on the IIS server itself, I get a 401-Unauthorized message.
In addition, I've tried installing the web service on a second server, myserver2.mydomain.com. Again I can call my test script fine from BOTH my workstation and from myserver1.
So it seems the only issue is when the client is on the same box as the web server itself - somehow the windows credentials are not being passed or recognized.
I tried playing with IE settings on myserver1 (checked and unchecked 'Enable Windows Integrated Authentication', and added the URL to Local Sites). That did not seem to have an effect.
When I look at the IIS logs, I see the 401 unauthorized line but very little other information.
I see basically the same behavior when testing with IE (v9) - works from my workstation but not when IE is running on the IIS server.
I found the answer after several hours:
By default, there is something called a LoopbackCheck which will reject windows authentication if the host header used for the site does not match the local host's name. This behavior will only be seen when the client is on the local host. The check is there to defeat possible reflection attacks.
More details here:
http://support.microsoft.com/kb/896861
The kb item discusses ways to disable the Loopback check, but I ended up just switching from using host headers to ports to distinguish the different sites on the IIS server.
Thanks to those who gave assistance.
Try checking the actual credential that is being passed when you are running on the server itself. Often times you will be running on some system account that doesn't have access to the resource in question.
For example, on your box your credentials are running as...
MYDOMAIN\MYNAME
and the server will be something like...
SYSTEM\SYSTEM_ACCOUNT
and so this will fail because 'SYSTEM\SYSTEM_ACCOUNT' doesn't have credentials.
If this is the case, you can fix the problem in one of two ways.
Give 'SYSTEM\SYSTEM_ACCOUNT' access to the resource in question. Most people would avoid this strategy due to security concerns (which is why the account has no access in the first place).
Impersonate, or change the credentials of the client manually to something that does have access to the resource, 'MYDOMAIN\MYNAME' for example. This is what most people would probably go with, including myself.

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.