1

I created WCF service (last year) that is consumed by Silverlight application and it doesn't have metadata (doesn't have IMetadataExchange endpoint).

Now I need WCF service to be consumed by windows console application and I can't add reference to service. I click 'Add Service' discover solution's services, selected 'required' service and clicked 'Ok' button.

Instead of service reference created I got the following error:

The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'http://localhost/EnrollmentService.svc'. There was no endpoint listening at http://localhost/EnrollmentService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found. If the service is defined in the current solution, try building the solution and adding the service reference again.

Should I work on adding metadata support for WCF service or it should be another solution?

Please advice.

Budda
  • 18,015
  • 33
  • 124
  • 206

1 Answers1

4

You can use a WCF Service without exposing metadata.

Metadata is used to generate a proxy by Visual Studio or any other tool. So, in case you don't expose metadata, you are going to have to create/write these proxy classes yourself.

As long as you use correct service address and right data contracts, you are good to go.

Accessing WCF service without creating Proxy

decyclone
  • 30,394
  • 6
  • 63
  • 80
  • So I need to generate those proxy's myself? no, I would better add metadata support... But thank you for your answer – Budda Jan 10 '11 at 15:09
  • Take a look at the link added. Its worth knowing how to do it. – decyclone Jan 10 '11 at 15:11
  • I've token. But thanks, I would better go with metadata. In my case services has a lot of parameters, are subject of change, so need to be easy-to-support. That will be provided by metadata. – Budda Jan 10 '11 at 15:36