Step 1: Create one WCF Service Application and add the below line for OperationContract
[WebInvoke(Method = "POST",BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
<system.serviceModel>
<services>
<service behaviorConfiguration="Default" name="WcfService1.Service1">
<endpoint address="web" behaviorConfiguration="webBehavior" binding="webHttpBinding" contract="WcfService1.IService1" />
<endpoint address="ws" binding="wsHttpBinding" bindingConfiguration="wsBehavior" contract="WcfService1.IService1" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webBehavior">
<webHttp />
<!--<enableWebScript/>-->
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="wsBehavior">
<security mode="None" >
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
Step 3: Run the web service(in visual studio) and Copy the Service URL
Step 4: Add the parameters(ref the below screenshot) in Postman and send the request and you will get the successful response
Cheers, 😃 and enjoy your life.
This comment has been removed by the author.
ReplyDeleteHey Narendra..its really work for me..nice post thanks buddy gud job 🙂👍
ReplyDelete