Silverlight failing with Cross Domain Error - asp.net

I have an application that is built using ASP.NET, with an embedded Silverlight Object that communicates with a WCF back end. It is set up like so:
Server 1: Hosts ASP.NET Website on IIS7
Server 2: Hosts WCF Application on IIS7
My Machine will try to access Server 1 over the internet to log in to the website. Server 1 will the authenticate the user using the WCF Web Service over our internal network on Server 2. I can do this but when it loads the silverlight object it crashes, complaining about CrossDomain/ClientAccessPolicy failure. So to be sure I put those two files on every folder in the inetpub/wwwroot on both Server 1 and 2, just to be sure. But I am still getting the same error.
When I run the application from Server 1, it can connect to the site through its local network IP and it all works, it also works when I run the ASP.NET application from Visual Studio 2010 on my own machine, with the web service references pointing to Server 2.
I am almost at my wits end, there have been so many red herrings that I have tried and none have worked. I am not even sure if it is Silverlight/WCF or the IIS configuration on each server that is breaking it.
If anyone can help me shed some light on this I would greatly appreciate it.
Thanks,
Stuart.

one idea could be to use fiddler and find the request which is making crossdomainpolicy xml request. Is that failing? Check the address it is pointing to. I debugged my issue using that. It was pointing to root of the server and my crossdomainpolicy xml was in WCF project folder.

I found the issue to my problem. I was not realising that the Silverlight application was trying to access a web service that was restricted by firewalls, so I had to create another web service that would re-route through the website and to the original web service.
What a bloomin' pain!

Related

Why is hosting outside of IIS termed as self host?

In general, if a third service provider manages the web server for me then it is hosted, while if I am by myself managing the web server then it is self-hosting.
In ASP.NET Core, In both places, I am the one who publishes the code on the server, at the time of IIS it is not called self-hosting? what exactly does "self" means?
For me as a programmer, self-hosting means the application should be able to host itself, which means it must be able to listen to the web requests directly or it must run on its own process. Am I wrong? Please someone help me to understand the meaning of "self" in self-hosting.
Also, the image Microsoft uses to explain self-host is very confusing to me, as far as I know, IIS uses w3wp.exe to execute the application as:
The above image is good, w3wp is the process within that our app executes and IIS is the overall container.
But now, look at this image:
Here the application is the wrapper and Kestrel is within the application and the process (dotnet.exe / application.exe) is the wrapper containing Kestrel, why is it so?
For me, it should be
Why is my image different from Microsoft's image for self-hosting? Where am I missing the concept?
I think that you need to extend the concept:
Hosted is essentially an application (web app) exposed via a third party service that run a server (web server) for you.
Self hosted is the same application exposed via a server managed by you.
Sometimes, as correctly mention by Vineet, self hosted stands for an application with a server process exposing the application itself. Like Kestrel for Blazor.
IIS is not the discriminant for hosted or self-hosted, is just the base of the concept.
From my point of view when I use IIS Express integrated in Visual Studio debug, the application is self hosted and hosted at the same time.
Is hosted in IIS Express from a web server perspective and, at the same time, is self hosted from a service perspective.
Just for information: the applicationName.exe produced by the compiler for Blazor app is just a launcher based on Kestrel. Is a web server that launch the applicationname.dll
An example below from two total different application. The executable (you can open it with a binary editor) is the same.

Running ASP.Net server - Must be from visual studio?

I'm pretty new to ASP.Net and I've been having troubles understanding something.
I made a web application project with a web service on my computer.
I made another web application project, who then consumed the WSDL from the web service on the first project and uses a function in it.
I ran each on a different VS2012 Instance and when both projects are running in then there is no problem and it works fine.
When i close the VS Instance with the Web Service project then I get a Coonnection Error which is also logical.
My question:
Is there a way to keep the server running without keeping visual studio open?
There is no ".exe" generated or anything so I don't know what to run in order to keep the "Server" running..
Additional question if you don't mind:
If I want to use this service from another computer on the same Network, will the "localhost:.....?WSDL" service reference still work or do I need another address?
Sorry for my lack of knowledge, I just couldn't find a good guide explaining about how to keep the server running anywhere.
Thank you, Mellor.
Host your web service in localhost
use the computername instead of localhost in WSDL URL when you add services/web reference in cleint applications

How to host and deploy an ASP.NET web application on a local server

I have created a small web application with one page only. Now I want to host and deploy this application on one of our business's server so that anyone can access this small app.
Could please anyone tell me what will be the process as I don't have any previous knowledge or experience of doing this also, what changes I do need to make in my web config and the IIS configuration.
Kind Regards
Firstly: Install IIS on the server that you want to host your application on
Secondly: Setup the site in iis
Thirdly: If you have a database connection in your app check that the connection string is updated
Fourthly: Make sure that the relevant port in the firewall is not blocked

Debug ASP.NET application hosted on shared server from my VS2010 IDE

i have web site and it is hosted on shared server ORCSWEB. now when i testing one page locally then i found it is running fine but when i test the same page putting our live site url then i found it is not working. so i want to test that from live site but from my own VS2010 IDE and want to set break point. i just do not know is it possible or not but i can not install any remote debugger there due to lack of access.
i visit this url for gudance http://www.codeproject.com/Articles/38132/Remote-IIS-Debugging-Debug-your-ASP-NET-Applicatio
but i could not help me. thanks
I'm not an Orcsweb customer, but you cannot do Remote Debugging unless the VS Remote Debugger service is running on the target machine. If I were a shared webhost then I wouldn't provide this service to my customers because it's a massive security liability.
Out of curiosity, why can't you fix it based on any exception reports generated right now?

Flex app not hitting web service

I have zero knowledge on flex and need help to determine what is preventing my web service from being called.
We have a working application in production and the developer who wrote it has left.
I am trying to build it on my machine and I can see a web service call in fiddler being made with the URL "/Services.asmx/MethodName" (as a GET request).
I have set my break point in the asmx web service and it is not being hit. All I get in the flex front end is a pop up with " The remote server failed to respond and may be offline. http://MachineName/Services.asmx/MethodName"
The web service is in the same application as the web app that hosts the SWF file.
I have the cross domain policy file in place.
What I noticed in fiddler is the URL is "/Services.asmx/MethodName" and not "/WebApp/Services.asmx/MethodName" (not sure if this makes a difference) where WebApp is the IIS virtual directory to the web application that hosts the SWF.
Any ideas?
JD
If you are Web-services and your web-application is same domain then just pass the whole path like "http://..../Services.asmx" for creating web-service api instance in ActionScript 3.0 (for flex). and use this instance name to call your web-service method.
Please read this article from Adobe help for your perfect answer

Resources