[OperationContract]
[WebInvoke(UriTemplate = "AddPost",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
string AddPost(string title, string description, string startTime, string endTime, string noticeTypeId, string groupId, string userId, string approvalStatus);
[OperationContract]
[WebInvoke(UriTemplate = "spName={spName}&inputxele={inputxele}&transType={transType}",
BodyStyle = WebMessageBodyStyle.Wrapped,
Method = "POST",
RequestFormat = System.ServiceModel.Web.WebMessageFormat.Json)]
string ValidateCredentials(string spName, string inputxele,string transType);
And web.config code is like this
="1.0"="utf-8"
<configuration>
<connectionStrings >
<add name="DBConnection" connectionString="Integrated Security=true;Data Source=MKTDESK1-PC\SQLEXPRESS;Initial Catalog=EmpDB" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.serviceModel>
<services>
<service name="JsonWcfService.GetEmployees" behaviorConfiguration="EmpServiceBehaviour">
<endpoint address ="" binding="webHttpBinding" contract="JsonWcfService.IGetEmployees" behaviorConfiguration="web">
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://localhost/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="EmpServiceBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
</configuration>