2
Answers

How to implement only server to server call access method

Hari Babu

Hari Babu

7y
224
1
HI 
 Please advice how we can implement only server to server  accessable method in WCF.
meaning i want restrict the method call when cleint request from client code.
 
Please advice.
 
 
Answers (2)
0
Mukesh Nayak

Mukesh Nayak

NA 1.5k 317.4k 7y
Hi Hari,
 

We need to learn about various WCF binding available. If your WCF service is getting consumed by client side code that means your WCF service is acting as REST service and it must be having “webHttpBinding”. Now if you don’t want you service to get consumed by client you can choose “basicHttpBinding”, it will act as exactly same as soap service and won’t support any client side consumption of WCF service. Now each binding has got its own advantage and limitation.

For more information please refer following link:

“http://www.c-sharpcorner.com/uploadfile/pjthesedays/wcf-service-binding-explained/”

“http://www.dotnettricks.com/learn/wcf/understanding-various-types-of-wcf-bindings”

Regards,
Mukesh nayak 
0
Ibrahim Ersoy

Ibrahim Ersoy

NA 27.9k 3.4m 7y
Hello Hari,
 
I think you can manage it by adding IP Filter to your config file.IPFilter adds specific IP Address so that any client who doesnt have the same IP fails to connect.

In your scenario, you can implement the server IP address in wcf config file and limit only this one to be able to connect and consume service.
 
Sample usage:

  1. <serviceBehaviors>  
  2.  <behavior name="WCFServiceBehaviour">  
  3.       <serviceMetadata httpGetEnabled="true" />  
  4.       <serviceDebug includeExceptionDetailInFaults="true" />  
  5.       <IPFilter filter="127.0.0.1" />            
  6.  </behavior>  
  7. </serviceBehaviors>