Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
[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);

C#
[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

XML
<?xml version="1.0" encoding="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>
Posted
Comments
Jameel VM 5-Dec-14 6:29am    
what is the problem now?
Raghu Golla 5-Dec-14 6:56am    
Is it ok or
i have to change any thing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900