Click here to Skip to main content
15,882,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

I've been following an article on Implimenting a simple WCF Service, but I've hit a roadblock. The article im using is:

Implementing a Basic Hello World WCF Service
http://www.codeproject.com/KB/WCF/HelloWorldWCF.aspx

I have created the WCF service, and can see the service in my browser. The problem is that when I click on the service
(in my case: http://localhost:8080/HostDevServer/HelloWorldService.svc?wsdl)
I do not get any XML code.

I just get the following:
http://localhost:8080/HostDevServer/HelloWorldService.svcMMorris-PC2\MMorris
(MMorris-PC2\MMorris is my machine\username).

There is just no XML?!?! Everything else has worked up until this point.

Any ideas?

I'm running VS2010 on Win7.

Many Thanks,
Michael
Posted

1 solution

Hi, first check to make sure that you have meta data publishing enabled on the WCF Service. This is done by adding an meta data exchange endpoint in the web.config.

<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex">

This is the part of the service that describes the capabilities of the service in WSDL.

Second make sure that you have decorated the interface with the ServiceContract and OperationContract attributes.

[ServiceContract]
public interface IHelloWorldService
{
[OperationContract]
String GetMessage(String name);
}

Hopes this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900