Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a Restfull Wcf Service which as method as Getname(),It returns a string.
now i trying to test using WCF Test Client,but it didn't shown the method on the WCF test client window.
pleas let me know what is the reason of this?
Thanks in Advance.
this is my service.

in IRestFullService.cs

C#
using System.ServiceModel.Web;
namespace RestWcfGetname
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IRestFullService" in both code and config file together.
    [ServiceContract]
    public interface IRestFullService
    {
        [OperationContract]
        [WebInvoke(Method = "Get", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "json/id")]
        string GetPassedName(string id);
        [OperationContract]
        [WebInvoke(Method = "Get", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "")]
        string GetName();
    }
}


in RestFullService.svc

C#
using System.ServiceModel;
using System.Text;

namespace RestWcfGetname
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "RestFullService" in code, svc and config file together.
    public class RestFullService : IRestFullService
    {
        #region IRestFullService Members
        public string GetPassedName(string id)
        {
            return "i am from wcf service " + id;
        }
          public string GetName()
          {
              return "Hi Welcome to WCF Service";
          }
      #endregion
    }
}
Posted

1 solution

yea in latest frame work they atached direct rest template may it present on tht one or u can download it in online templates in visualstudio
 
Share this answer
 
Comments
Unareshraju 10-Sep-12 5:44am    
hi mani,
i am using vs2010 but no issues in the test client .but i am guessing may need to set some properties .

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



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