Visual Studio 2010에서 C#으로 매우 기본적인 WCF 서비스를 만들고 있습니다. 브라우저에서 직접 메서드를 실행할 수 있는지 알고 싶습니다. //localhost:49815/Service1.svc/methodName(parameterValue)
?브라우저에서 WCF 메서드 실행
여기 내 코드의 본질입니다.
인터페이스 :
using ...
namespace WcfService1{
[ServiceContract]
public interface IService1{
[OperationContract]
[WebGet]
string echoWithGet(string s);
[OperationContract]
[WebInvoke]
string echoWithPost(string s);
}
}
방법 :
public string echoWithGet(string s){
return "Get: "+s;
}
public string echoWithPost(string s){
return "Post: " + s;
}
그냥 궁금해서 ... 시도해 보셨습니까? –
참고 : http://msdn.microsoft.com/en-us/library/bb412178.aspx –
예, "시도"하여 내 제안 된 형식을 통해 메서드를 호출하는 참조하는 경우. – javaNinja