Using a URI to access a SOAP webservice instead of IP - c#

I have a test web-service: https://r3reports.retain3d.com/API/Reporting.asmx
In my production i have the following structure:
- IIS Application for my main application
- IIS Application within the main application for my webservice
When running from Visual Studio, my app is able to talk to the webservice without issue (it is pointing at the url above, not a locally hosted version). BUT when it runs in production, the TEST call times out because it is trying to use the IP to get to the webservice instead of the URL name (which is what is configured in IIS for SSL purposes). What am i doing wrong and how can i force the SOAP call to use the URL instead of the IP?

Fixed it, turns out we had to modify the host file on the server to properly map the child app to the right IP (it was resolving to the external IP which wasn't bound to my application instance)

Related

Run a webservice inside a windows service not IIS

creating my first webservice and need some assistance. i'm trying to create a web service to send data on a machine that doesn't have IIS. I have seen examples of this on msdn Host web service outside IIS.
My question so far is the address for the web server as the one in the example uses Http://localhost/WSEHostedWebService, i'm not sure what to use here as there is no web application or even IIS running on the intended machine. Should this point to a directory on the intended machine i.e. c:\webservice\myFirstService.asmx ?
To quote them "The following code example creates a Windows service named WindowsServiceToHostASMXWebService that hosts a Web service named Service at the soap.tcp://localhost/Service endpoint." - Try saying that fast with a mouth full of water :D
Anyhoo, unless you specifically need ye olde worlde asmx service do it in a WCF web service inside a windows service instead read this and this other link with example
As the link above says WCF handles the HTTP stuff outside of IIS anyhow.

C# Web service works in console but not from asp.net website on IIS server

I'm using a web service which works fine when I run it on my machine in an ASP.NET application using the default IIS Express VS 2010 comes with. However, when I move it to our server with IIS I get the error:
Error: There was no endpoint listening at 'web service name here' that could accept the message. This is often caused by an incorrect address or SOAP action.
'web service name here' is just a placeholder I put for this post. It has the right web service name.
So I pulled out the small login code that this is failing on into a console application and ran that from the IIS server and it worked! So I have to assume this is some kind of permissions issue with the IIS server on how it's running my web service code? In my ASP.NET program I have a separate DLL that handles the web service. The ASP.NET application fires off a separate thread that uses the DLL I made that uses the web service. Is it something to do with the separate thread permissions maybe? Any ideas?
Your first step when faced with this sort of issue is to search your config files for "web service name here" (or if this isn't actually the message you're getting the address given in the message). My suspicion is somewhere you'll have a WCF reference set up which needs a proper IP address.
Once you've got the address (assuming it looks valid) you need to check you can access it from the machine which is having the difficulties - it may be a firewall issue.
Now that you've established that your console application is connecting correctly from the same machine the next step is to check that both your IIS App Pool and Console application are running under the same user account/permissions. It may be that one identity has permission to access the network/internet and the other one doesn't.

Fail to reach WCF Data Service over LAN

I created an ASP.NET WEB project in VS2012 and add a WCF Data Service file(.svc).When i run, i can reach it(localhost:61388/default.svc), but i can't reach it in another computer by typing my host's ip address(192.168.1.4:61388/default.svc) and it shows BAD REQUEST-INVALID HOST NAME.
Then how can I reach my wcf data service from another computer?
I've turned off all firewalls and my os is windows 7 Pro
For that you need to host your WCF service in IIS server...To learn more about IIS server and add website see this
BY default there is a default website running at port 80.(You can check by typing http:\localhost) If you dont get anything that means IIS is not installed in your PC.
Once your IIS is up and running add your WCF service to IIS just like you add website to IIS (Or directly publish your WCF service in IIS publish-->IIS) and give it a specific port number (lets say your WCF service is running at 81).you can access the service from other computer (Lets say the PC which host has ip 10.20.50.121)...then you can access it on another computer by typing 10.20.50.121:81.
Now to connect your WCF service to Website,you need to check if your wcf service is running or not.For that when you publish your wcf service to IIS you get 3 files out of which one is default.svc(or any of your name you can click on the service go to contents view and see it) click it and on the right hand side click browse if you see a success page that your service is running then you need to copy that address an paste it in your Website webconfig endpoint address location and change the appopriate dns value .That should get your WCF service started
can you access it from your own computer using 192.168.1.4:61388/default.svc ? Or only localhost ? Run netstat -a and check the webserver is actually binding to the 1.4 address and not just to your local loopback adapter (127.0.0.1).
Create a virtual directly pointing to folder where your wcf svc is lying and try accessing it.

How to host a web service so other clients connected to same network can access

I am hosting web service in a one machine using Visual studio 2008. I tried accessing the web service from a web site i created in the same solution and it was successfully called. Now i want to access the web service from a remote client.
I initially developed the web service to used in an android application. As you can see if I wan to access the web service I will have to host is with a static IP. So at least to test the application i want access the web service from the android mobile by connecting both server and android mobile to one wifi network. For the initial test I connected two laptops(one is server) to the wifi router. And i pingd the server from the client machine and it got successfully pingd. But when i try to access the web service with given port from the browser it wont allow me to connect. I tried http://localhost:26796/ by replacing the localhost with ip of the server and also i tried making a small web site(asp) and try to access it from the client via IP. Both did not work. I have searched here and on web could not find a proper answer. for,
how to host a webservice so other clients in the same network can access..?
can it be fulfilled with VSD server..?
is it compulsory to use iis..?
How should i achieve this..?
NOTE: Moved from comments to answer as per user suggestion.
Publish the web service to your local machine's IIS as an Application. Then you can access the site from anywhere in your network. Running it directly from VS means it's hosted inside VS's ASP.NET Development Server (which, by default is only accessible locally). You can try opening up the port specified in the ASP.NET development server that starts up on your machine's local firewall, then you can access the debug instance being hosted

WCF 4 service responds to localhost address but not machine name

I am building a very simple WCF 4 service to test SharePoint External content list.
When I run the service, this works fine:
http://localhost:49669/Service1.svc?wsdl
But this does not:
http://machinename:49669/Service1.svc?wsdl
In the old 3.5 wcf services I would just update the config, but here the config files are empty.
What is the minimum that I need to put in the config file to get it to work, or is the problem somewhere else?
If you are using the integrated Visual Studio web server (Cassini), you cannot acess it from a different machine as only local access is allowed
You'll need to deploy your service or use IIS express to consume your service from a different machine

Categories