I have a simple WCF contract that contains both 'GET' and 'POST' operations. I have the service running on localhost. I am able to type the service address into my browser and see the service response values. When I try to do the same thing from C# code, I get the error "There was no endpoint listening at...." message. I can however call a 'POST' method on the service from in code.
What am I missing? Below is my Contract code
using System;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace WebServiceTest.Services
{
[ServiceContract]
public interface ITestOne
{
[OperationContract]
[WebInvoke(
Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "GetGreeting/{text1}/{text2}")]
string HelloWorld(string text1, string text2);
[OperationContract]
[WebInvoke(
Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "Greet/{text1}")]
string HelloWorld2(string text1);
[OperationContract]
[WebInvoke(
Method="GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "Add/{value1}/{value2}")]
int Add(string value1, string value2);
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped)]
String GetAllSpecies();
[OperationContract]
[WebInvoke(
Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "specie")]
String GetAllSpecies2();
}
}