1

I am attempting to test a WCF web service I'm developing by accessing it using a Winforms client in Visual Studio. The WCF service is being hosted by the Visual Studio ASP.NET development server, and I can see it when I access it via my web browser (it gives me the "You've created a service." page). However, when I attempt to connect to it through the Winforms client (which is configured to point to my local service), it says:

There was no endpoint listening at http://localhost:8181/{Web Application}/{SVC File}.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

There is no value in InnerException. {Web Application} and {SVC File} are actually populated with the correct values, I just removed them from the exception message.

Any ideas as to why this isn't working and how I can correct it?

Adam Robinson
  • 182,639
  • 35
  • 285
  • 343
  • Is it just this service, and can you get other WCF client/server connections going? Maybe make a simple solution (from scratch) with the default WCF template and a simple client. Worst, case, disable the firewall and start VS as Admin. – H H Aug 05 '10 at 18:50
  • @Henk: At this point I'm trying to get it working in local IIS, but I'm encountering the same issue (it's trying to load 4.0 assemblies even though it targets 3.5) as I was on the testing server. See [this question](http://stackoverflow.com/questions/3417257/inexplicable-assembly-load-in-wcf-service-iis-7). If I can get that working, then I won't much care about VS not working. – Adam Robinson Aug 05 '10 at 18:56

1 Answers1

2

First, you need to use local IIS rather than the ASP.NET development server, which is a good habit. Once you do this, make sure you have anonymous granted with permission for the new Web application.

Second, add the web service as a Service Reference.

Third, I used this snippet to test a web service under the above circumstances:

Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
    Dim ws As New ServiceReferenceName.WebMethodsSoapClient()
    Dim bs As New BindingSource()
    bs.DataSource = ws.NAmeofMethodinWebService(txtSearchCriteria.Text)
    DataGrid1.DataSource = bs
    DataGrid1.Visible = True
End Sub
websch01ar
  • 2,103
  • 2
  • 13
  • 22
  • Thanks, I'm actually working on doing this (I haven't yet been able to get this service working on an IIS server, including my local box). – Adam Robinson Aug 05 '10 at 18:19