Wednesday, April 16, 2014

Four Timeout Property for Bindings in WCF

Four Timeout Property for Bindings in WCF
sendTimeout: time taken by WCF service to respond to client
openTimeout: Amount of time client willing to wait for WCF service to open connection
closeTimeOut: Amount of time client close the proxy connection to WCF service
receiveTimeout: Time spent by client to process response received from WCF service

 
                 sendTimeout="00:25:00">
   

 


http://stackoverflow.com/questions/1520283/wcf-service-how-to-increase-the-timeout

Powershell Issue: SOAP header Action was not understood. when use wsHttpBinding

Powershell Script Calling WCF Service.

Issue: SOAP header Action was not understood. when use wsHttpBinding

This can be solved if we use basicHttpBinding.

You might want to use the basicHttpBinding to get it working with a .NET 2.0 client. That binding already provides the compatibility required by older clients or other platforms. If you still decide to go with wsHttpBinding, you will have to use Microsoft WSE to create messages in the .NET 2.0 client that are compatible with the wsHttpBinding.
With Above statement from Stackoverflow that means we can run powershell in .net 4 runtime to even overcome above problem.
http://stackoverflow.com/questions/8518282/how-to-communicate-with-a-wcf-service-wshttpbinding-a-net-2-0-client


http://stackoverflow.com/questions/2094694/how-can-i-run-powershell-with-the-net-4-runtime

Simply modify (or create) $pshome\powershell.exe.config so that it contains the following:
xml version="1.0"?> 
 
     useLegacyV2RuntimeActivationPolicy="true"> 
         version="v4.0.30319"/> 
         version="v2.0.50727"/> 
     

Path where this config file must be created :C:\Windows\System32\WindowsPowerShell\v1.0\

Sample Script to call WCF Service with Powershell as client
$uri="http://localhost:59889/Service1.svc"

$proxy = New-WebServiceProxy -Uri $URI -Class newClass1 -Namespace WebService1




$proxy.GetName()
#this is where we have int as input to service and string as output. GetData below ... 
 
$proxy.GetData(5,$true)