SelfHosting tutorial
http://msdn.microsoft.com/en-us/library/ms731758.aspxHow to publish metadata when using TCP binding:
1. Inside app.config, create service behavior element (e.g. HelloServiceBehavior)
2. Refer the behavior from service tag (behaviorConfiguration="HelloServiceBehavior")
3. Add endpoint to the service to exchange metadata, use contract="IMetadataExchange".
<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="HelloServiceBehavior"> <serviceMetadata policyVersion="Policy15" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <services> <service behaviorConfiguration="HelloServiceBehavior" name="HelloService"> <endpoint address="net.tcp://localhost:8080/hello" binding="netTcpBinding" bindingConfiguration="" name="HelloService" contract="IHelloService" /> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> </service> </services> </system.serviceModel> </configuration>
Using Async/Await
Async Cancellation/Progress is not supported
http://social.msdn.microsoft.com/Forums/en-US/async/thread/b1353952-ce52-4af7-b6ec-f792bef28566/
Enabling trace
netTcpBinding uses binary encoding and transport security, which delivers better performance.
Following URLS will help to get more information
Client proxy cannot be reused: http://stackoverflow.com/questions/1241331/recovering-from-a-communicationobjectfaultedexception-in-wcf
Solution: http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
Solution: http://bloggingabout.net/blogs/erwyn/archive/2006/12/09/WCF-Service-Proxy-Helper.aspx
Classes
ServiceContractAttribute: http://msdn.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.aspx
OperationContractAttribute: http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.aspx
ServiceBehaviorAttribute: http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.aspx
Performance
Concurrency and Throttling combinations http://www.codeproject.com/Articles/89858/WCF-Concurrency-Single-Multiple-and-Reentrant-and
Timeout
Open/Close/Send/Receive/Operation: http://cs.gogo-asp.net/blogs/libaty/archive/2009/11/02/WCF_6730E930A630F330C930C830EA30C330D7306E30BF30A430E030A230A630C830245092302D8A9A5B59308B306B306F30_.aspx
Detecting Disconnected Clients
http://stackoverflow.com/questions/665473/how-to-handle-wcf-client-disconnect
http://stackoverflow.com/questions/5338842/detect-socket-disconnect-in-wcf
http://stackoverflow.com/questions/5338842/detect-socket-disconnect-in-wcf
Reliable Messaging
Need to turn-off or set level to Message Security for Bindings (doesn't work if the level is set to the default Transport level)
Working case
- Server not available during the first connection
- Network cable is blipping
Not working case
- Server is down and restarted
WCF and WebSocket
WebSocket only available in Windows8 ? (http://msdn.microsoft.com/en-us/library/system.servicemodel.nethttpbinding.aspx)
http://msdn.microsoft.com/en-us/library/hh977020.aspx
http://www.codeproject.com/Articles/341413/What-s-new-in-WCF-4-5-WebSocket-support-Part-2-of
http://msdn.microsoft.com/en-us/library/hh977020.aspx
http://www.codeproject.com/Articles/341413/What-s-new-in-WCF-4-5-WebSocket-support-Part-2-of
Performance Tuning
http://blogs.msdn.com/b/dmetzgar/archive/2011/05/04/wcf-scales-up-slowly-with-bursts-of-work.aspx
No comments:
Post a Comment