service discovery during "Add Service Reference" - asp.net

i'm building an Asp.Net app (contains the service) with Silverlight control (need to use the service) and having a problem after i discover the service and press OK button, can anyone help me please?

Try/Check the following:
Your service project is being properly build with no errors.
There is no other IIS / IIS express servers running in background.
Try to open the service address that you are trying to consume in the browser and see if it is loaded OK.
This should give you a lead on the problem.

Related

"Adding sign-in with Microsoft" example does not work on my working VDI

Good day everyone!
Background: I have old legacy ASP.NET MVC on premise application running on local windows IIS. I'm investigating ways to integrate this application with Azure AD authentication. As far as I can understand (Windows IIS integration with Azure AD) it's not possible to do it directly because of the Azure AD authentication can be added at the application level only. So I'm thinking integrating one of the MSAL library for adding Azure AD authentication.
Using this windows manual (Quickstart: Add sign-in with Microsoft to a web app), I've downloaded sample windows application (ASP.NET code sample) from this learn page and tried to run it within the Visual Studio 2022 in debug mode on my azure virtual work machine (based on VDI platform).
And Azure AD authentication does not work. When I click "Sign in with windows" button on the start application page, I get the error:
Server Error in '/' Application.The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
Requested URL: /login.aspx
This sample works fine on my local laptop in exactly the same state. I suggest that any security utilities might be the reason, but I don't know how to check it. I can't disable security apps on my working machine, and maybe there are any restrictions on the network level I don't even know nothing about.
Could somebody suggest any ways to solve this problem? Or maybe still ways to find the reason of this problem?
Thank you in advanced!

How to stop WCF Service project from being hosted automatically while debugging

I have Asp.Net solution that contains few WCF Service projects. Every time i run the application in debug mode, i can see that my services being hosted on ASP.Net Development Server. I just have single project in the start up.
Is there a way i can avoid this without removing these WCF Service projects from the solution?
To reproduce the situation. Create one ASP.Net project and add several WCF Service projects. Press F5 and you will see the WCF service projects being hosted on local development server.
This is what i have tried so far:
1) Project->Properties->Don't open a page. Wait for a request from an external application. I selected this option but it still hosts the service.
2) Unchecked ASP.NET in Debuggers selection. It still hosts the service.
Try right click the WCF project and go to the WCF Options tab.
Uncheck the Start WCF Service Host when debugging another project in same solution.
Is this what you are looking for:

Silverlight failing with Cross Domain Error

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!

Visual Studio - 'Browse UDDI Servers' -> 404?

I have a ASP.Net application which implements a web service. Within the ASP.Net application there's a test script which consumes the web service and it all works etc.
I have built a .NET console application and want to 'Add a Web Reference' so that the console app can consume the web service provided by the ASP.NET application. When I use the 'Browse UDDI Servers on the local network' to do that any plausible URL I use results in a 404.
I'm guessing I need to do something to my ASP.Net application so that it acts as an UDDI server ? Does anyone know what ?
Update
I just wanted to clarify something - I'm not desperate to use UDDI it just seems that's the only option in my circumstances which are :
I'm actually doing this for another developer who is used to using Visual Studio to do this stuff
The other developers system will need to run on another machine within the same network.
OK I'm going to answer my own question here.
The key thing for me was that I didn't need an UDDI server in the first place - instead what I needed to do was to simply supply the 'Add Web Reference' dialog box with the URL for the .ASMX file within the ASP.NET application which defined the service I was after (and ignore the whole 'Browse UDDI Servers' thing). (I've actually done this before but was having a bad-brain day today)
More generally however if I did wish to use UDDI the answer I wanted appears to be here MSDN Forum post dated July 2007 -
> How do we add the UDDI server that we
> created to the local network? ...
> Just found where to do that :
>
> - Go to the UDDI Service Control MMC
>
> - Right click on the server and go to properties
>
> - Go to the "Active Directory" Tab
>
> - Click "Publish"
UDDI is a dedicated service on the network for registering Web Services and also for discovering/consuming web services. Think of it as a directory of web services for a local intranet.
Windows Server 2003 includes UDDI Services. You have to install it via Add/Remove -> Windows Components (similar to IIS, FrontPage Extensions, etc.).
If the problem is having a single repository of web services that can be discovered, then UDDI is a solution.
If the problem is using a single service on another machine, then just referencing an endpoint (asmx/svc) will suffice. UDDI is overkill in that scenario.
For the record, the OP did not actually want anything to do with UDDI. His assumption was false. UDDI is not actually used for anything.

Siverlight talk to server using WCF

I am doing an simple Siverlight app talk to server using WCF.When I run the app in visual studio,it works fine .However,when I hosted unders IIS,the data from the server will never returned.
Can anyone shine some light on this and how can I debug silverlight app with WCF?
you can try fiddler.
or enable wcf logging on a website that hosts your service, which will give you even more information. Read more here.
Are you receiving any kind of response from the server at all? Are your silverlight applications configured to reference the correct web services (not the visual studio web server)? Can you browse to your WCF services in the browser and get a response?
www.example.com/myservice.svc
Just a few ideas...
Use Attach to process. Remember Silverlight is running on the client so you can open the app in IE and then attach visual studio to it.
You may also want to look at Fiddler to check the traffic is going to the right place.

Resources