unable to add refrence of restful wcf service in windows service
When i tried to add the reference of restful wcf service to windows
service. I am getting "The type or namespace name 'RestfulService' could
not be found (are you missing a using directive or an assembly
reference?)" error.
MY Interface Is
[ServiceContract(Name = "RJContract",
Namespace = "RestfulService",
SessionMode = SessionMode.Allowed)]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate = "/rjdata/{name}")]
string RJData(string name);
}
App.Config
<system.serviceModel>
<services>
<service name="RestfulService.Service1">
<host>
<baseAddresses>
<add baseAddress =
"http://localhost:8732/RestfulService/Service1/" />
</baseAddresses>
</host>
<endpoint binding="webHttpBinding"
contract="RestfulService.IService1"
bindingConfiguration="RESTBindingConfiguration"
behaviorConfiguration="RESTEndpointBehavior"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="RESTBindingConfiguration">
<security mode="None" />
</binding>
</webHttpBinding>
<netTcpBinding>
<binding name="DefaultBinding">
<security mode="None"/>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="RESTEndpointBehavior">
<webHttp helpEnabled="true" defaultOutgoingResponseFormat="Json"
automaticFormatSelectionEnabled="true"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"
aspNetCompatibilityEnabled="true" />
</system.serviceModel>
But i am able to add the reference with the following.
[ServiceContract(Name = "RJContract",
Namespace = "RestfulService",
SessionMode = SessionMode.Allowed)]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate = "/rjdata/{name}")]
string RJData(string name);
}
No comments:
Post a Comment