views:

68

answers:

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?

A: 

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
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
What error are you getting when publishing to IIS?
websch01ar