My simple sample wcf service WAS working, but then all of a sudden it started prompting me for an endpoint address in a "WCF Test Client" dialog.
I can't recall changing anything that would cause it to go from popping up the browser (IE 8) when I hit F5 to now displaying this "WCF Test client" thing.
I didn't know what to enter into the edit box it provided, so I tried "http://localhost:4841/RestServiceImpl.svc" (http://localhost:4841/RestServiceImpl.svc/xml/123 still works from outside of Visual Studio)
It accepted that ("Service added successfully" displays in the dialog's task bar), but does nothing else; and clicking the "My Service Projects" Treeview does nothing (it has no children).
UPDATE
If I attempt to run the new operation directly from IE8, I get:
Server Error in '/' Application.
In contract 'IRestServiceImpl', there are multiple operations with Method 'GET' and a UriTemplate that is equivalent to 'xml/{platypusId}'. Each operation requires a unique combination of UriTemplate and Method to unambiguously dispatch messages. Use WebGetAttribute or WebInvokeAttribute to alter the UriTemplate and Method values of an operation.
Does this mean I can only have one xml-returning operation that takes a string? The other/original method is ...xml/{id}...
UPDATE 2
This is the code, and it's still failing:
[ServiceContract]
public interface IRestServiceImpl
{
[OperationContract(Name="Foo")]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "xml/{id}")]
string XMLData(string id);
[OperationContract(Name="FooBar")]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "xml/{platypusId, anotherId}")]
string FirstTrial(string platypusId, string anotherId);
[OperationContract(Name="FooFooBar")]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "json/{id}")]
string JSONData(string id);
}
// Implementation (.svc) file
public class RestServiceImpl : IRestServiceImpl
{
public string XMLData(string id)
{
return "You requested product " + id;
}
public string FirstTrial(string platypusId, string anotherID)
{
return "I reckon so" + platypusId + anotherID;
}
public string JSONData(string id)
{
return "You requested product " + id;
}
}