What is the best way to get intellij keybindings in Monodevelop/Xamarin studio - xamarin-studio

What is the best way to get intellij keybindings in Monodevelop/Xamarin studio (in a windows machine)
tried this but did not affect the keybindings behaviour :|

Those key binding contain conflicts with XS and MD version 5.0.
I forked that project and modified three conflicts in order to get this to load.
https://github.com/sushihangover/MonoDevelopIntellijizor
I actually used these a year ago but while I love Intellij (for ActionScript coding), its Function Key binding are so non-OS-X based...
Here is the updated "Custom.mac-kb.xml" in case Github is down, hahaha:
<schemes version="1.0">
<scheme name="current">
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.Debug" shortcut="F5" />
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.Run" shortcut="Shift+F10" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.GotoType" shortcut="Meta+N" />
<binding command="Pad|MonoDevelop.Debugger.BreakpointPad" shortcut="Meta+Shift+F8" />
<binding command="MonoDevelop.Debugger.DebugCommands.Debug" shortcut="F5" />
<binding command="MonoDevelop.Debugger.DebugCommands.StepInto" shortcut="F7" />
<binding command="MonoDevelop.Debugger.DebugCommands.StepOver" shortcut="F8" />
<binding command="MonoDevelop.Debugger.DebugCommands.StepOut" shortcut="Shift+F8" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.NextBookmark" shortcut="Meta+F11" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.PrevBookmark" shortcut="Shift+F11" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.ToggleBookmark" shortcut="F11" />
<binding command="MonoDevelop.Ide.Commands.WindowCommands.SwitchSplitWindow" shortcut="" />
<binding command="Pad|MonoDevelop.Ide.Gui.Pads.ErrorListPad" shortcut="Alt+Shift+E" />
<binding command="Pad|MonoDevelop.Debugger.LocalsPad" shortcut="Meta+D|L" />
<binding command="Pad|MonoDevelop.Debugger.StackTracePad" shortcut="Meta+D|C" />
<binding command="Pad|MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator" shortcut="Meta+D|Q" />
<binding command="Pad|MonoDevelop.Debugger.WatchPad" shortcut="Meta+D|W" />
<binding command="Pad|ClassPad" shortcut="Alt+Shift+C" />
<binding command="Pad|MonoDevelop.DesignerSupport.PropertyPad" shortcut="Alt+Shift+P" />
<binding command="Pad|ProjectPad" shortcut="Alt+Shift+S" />
<binding command="Pad|MonoDevelop.Ide.Gui.Pads.TaskListPad" shortcut="Alt+Shift+T" />
<binding command="Pad|MonoDevelop.DesignerSupport.ToolboxPad" shortcut="Alt+Shift+B" />
<binding command="Pad|ConnectionManagerPad" shortcut="Alt+Shift+D" />
<binding command="Pad|MonoDevelop.Ide.Gui.Pads.HelpTree" shortcut="Alt+Shift+F1" />
<binding command="Pad|MonoDevelop.DesignerSupport.DocumentOutlinePad" shortcut="Meta+F12" />
<binding command="MonoDevelop.Refactoring.RefactoryCommands.FindDerivedClasses" shortcut="Meta+Alt+B" />
<binding command="MonoDevelop.Refactoring.RefactoryCommands.FindReferences" shortcut="Alt+F7" />
<binding command="MonoDevelop.Refactoring.RefactoryCommands.GotoDeclaration" shortcut="Meta+B" />
<binding command="MonoDevelop.Debugger.DebugCommands.AddTracepoint" shortcut="" />
<binding command="MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator" shortcut="Alt+F8" />
<binding command="MonoDevelop.Ide.CodeFormatting.CodeFormattingCommands.FormatSelection" shortcut="Meta+Alt+L" />
<binding command="MonoDevelop.Refactoring.RefactoryCommands.IntroduceConstant" shortcut="Meta+Alt+C" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.IndentSelection" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.ToggleCodeComment" shortcut="Meta+/" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.UnIndentSelection" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.ToggleAllFoldings" shortcut="Meta+Shift+=" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.ToggleFolding" shortcut="Meta+=" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.CloseFile" shortcut="Meta+Escape" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.CloseAllFiles" shortcut="Meta+Shift+Escape" />
<binding command="MonoDevelop.Ide.Commands.FileTabCommands.CloseAllButThis" shortcut="Meta+Alt+Shift+Escape" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.NewFile" shortcut="Meta+Alt+Insert" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.OpenFile" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.PrintPreviewDocument" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.PrintDocument" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.Exit" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.SaveAs" shortcut="Meta+Alt+S" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.NewProject" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.SaveAll" shortcut="Meta+S" />
<binding command="MonoDevelop.NUnit.Commands.TestCommands.RunAllTests" shortcut="" />
<binding command="MonoDevelop.NUnit.Commands.TestCommands.ShowTestDetails" shortcut="Meta+Alt+T" />
<binding command="MonoDevelop.DesignerSupport.Commands.SwitchBetweenRelatedFiles" shortcut="Meta+Alt+Home" />
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.Build" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.BuildSolution" shortcut="Meta+F9" />
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.Rebuild" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.RebuildSolution" shortcut="Meta+Alt+Shift+B" />
<binding command="MonoDevelop.Refactoring.RefactoryCommands.IntegrateTemporaryVariable" shortcut="Meta+Alt+N" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.GotoLineNumber" shortcut="Meta+G" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.GotoFile" shortcut="Meta+Shift+N" />
<binding command="MonoDevelop.Ide.NavigateToDialog.Commands.NavigateTo" shortcut="Meta+Alt+Shift+N" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.DeleteToLineEnd" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.DocumentEnd" shortcut="Meta+Page_Down" />
<binding command="MonoDevelop.CSharp.ExpandCommands.ShrinkSelection" shortcut="Meta+Shift+W" />
<binding command="MonoDevelop.CSharp.ExpandCommands.ExpandSelection" shortcut="Meta+W" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.GotoMatchingBrace" shortcut="Meta+]" />
<binding command="MonoDevelop.XmlEditor.Commands.RunXslTransform" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.ShowCodeTemplateWindow" shortcut="Meta+J" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.MoveBlockDown" shortcut="Meta+Shift+Down" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.MoveBlockUp" shortcut="Meta+Shift+Up" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveEnd" shortcut="Shift+End" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.ShowParameterCompletionWindow" shortcut="Meta+P" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.ToggleBlockSelectionMode" shortcut="Alt+Shift+Insert" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.DeleteLine" shortcut="Shift+Delete" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.ToggleCompletionSuggestionMode" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveToDocumentEnd" shortcut="Meta+Shift+Page_Down" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveToDocumentStart" shortcut="Meta+Shift+Page_Up" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.DocumentStart" shortcut="Meta+Page_Up" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveHome" shortcut="Shift+Home" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveNextWord" shortcut="Meta+Shift+Right" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMovePrevWord" shortcut="Meta+Shift+Left" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.MoveNextWord" shortcut="Meta+Right" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.MovePrevWord" shortcut="Meta+Left" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.LineEnd" shortcut="End" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.LineStart" shortcut="Home" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.PageUp" shortcut="Page_Up" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.PageDown" shortcut="Page_Down" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveUp" shortcut="Shift+Up" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveDown" shortcut="Shift+Down" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveLeft" shortcut="Shift+Left" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionMoveRight" shortcut="Shift+Right" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionPageDownAction" shortcut="Shift+Page_Down" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.SelectionPageUpAction" shortcut="Shift+Page_Up" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.DeleteNextWord" shortcut="Meta+Delete" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.DeletePrevWord" shortcut="Meta+BackSpace" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.InsertNewLineAtEnd" shortcut="Shift+Return" />
<binding command="MonoDevelop.Ide.Commands.TextEditorCommands.InsertNewLinePreserveCaretPosition" shortcut="Meta+Return" />
<binding command="MonoDevelop.Ide.Commands.FileCommands.Save" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.WindowCommands.SwitchPreviousDocument" shortcut="Meta+Alt+E" />
<binding command="MonoDevelop.Ide.Commands.WindowCommands.NextWindow" shortcut="Alt+Right" />
<binding command="MonoDevelop.Ide.Commands.WindowCommands.PrevWindow" shortcut="Alt+Left" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.FindNext" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.FindPrevious" shortcut="" />
<binding command="MonoDevelop.Ide.CodeFormatting.CodeFormattingCommands.FormatBuffer" shortcut="Meta+Alt+Shift+L" />
<binding command="MonoDevelop.Debugger.DebugCommands.ToggleBreakpoint" shortcut="Meta+F8" />
<binding command="MonoDevelop.VersionMeta.Git.Commands.Stash" shortcut="Control+Shift+K" />
<binding command="MonoDevelop.VersionMeta.Commands.UpdateSolution" shortcut="Control+T" />
<binding command="MonoDevelop.VersionMeta.Commands.SolutionStatus" shortcut="Control+K" />
<binding command="MonoDevelop.SourceEditor.SourceEditorCommands.ToggleCodeFocus" shortcut="" />
<binding command="MonoDevelop.VersionMeta.Git.Commands.ManageStashes" shortcut="Control+Shift+T" />
<binding command="MonoDevelop.Ide.Commands.SearchCommands.Replace" shortcut="Meta+R" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.Rename" shortcut="Shift+F6" />
<binding command="MonoDevelop.Refactoring.RefactoryCommands.DeclareLocal" shortcut="Meta+Alt+V" />
<binding command="MonoDevelop.NUnit.Commands.TestCommands.ShowTestCode" shortcut="F4" />
<binding command="MonoDevelop.Ide.Commands.ViewCommands.ShowNext" shortcut="Meta+Alt+Down" />
<binding command="MonoDevelop.Ide.Commands.ViewCommands.ShowPrevious" shortcut="Meta+Alt+Up" />
<binding command="MonoDevelop.Debugger.DebugCommands.EnableDisableBreakpoint" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.ProjectCommands.Stop" shortcut="Shift+F2" />
<binding command="MonoDevelop.Debugger.DebugCommands.SelectExceptions" shortcut="Meta+Alt+Shift+F8" />
<binding command="MonoDevelop.CSharp.Highlighting.MoveToUsagesCommand.PrevUsage" shortcut="" />
<binding command="MonoDevelop.CSharp.Highlighting.MoveToUsagesCommand.NextUsage" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.NavigationCommands.NavigateBack" shortcut="Alt+Meta+Left" />
<binding command="MonoDevelop.Ide.Commands.ViewCommands.PreviousNotebook" shortcut="Control+Shift+Z" />
</scheme>
</schemes>

Related

The remote server returned an error: (413) Request Entity too Large WCF

I have a windows application to send image to server using WCF service. When I run my code and upload an image, WCF returns "The remote server returned an error: (413) Request Entity Too Large."
I have tried several ways from links but not solved.
The following is my WCF Config.
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation targetFramework="4.5.2" />
<httpRuntime maxRequestLength="2147483647" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
The following is app.config from Windows app.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ILicencePhoto" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport" />
</binding>
<binding name="BasicHttpBinding_IUserLogging" >
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://xxxxx/wcf/image.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILicencePhoto"
contract="LicencePhoto.ILicencePhoto" name="BasicHttpBinding_ILicencePhoto" />
<endpoint address="https://xxxxx/wcf/user.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IUserLogging" contract="UserLogging.IUserLogging"
name="BasicHttpBinding_IUserLogging" />
</client>
</system.serviceModel>
I can log in with calling userWCF. The problem is when uploading user photo to WCF services. The user photo file size is only about 500KB max.
Thanks.
Nyi Nyi Aung
The main problem is that we don’t apply the configuration on the server-side. Since the server-side uses ProtocolMapping feature to enable the service works over HTTPS protocol, we should modify and apply the configuration on the BasicHttpsBinding instead of the BasicHttpBinding.
Please refer to the below configuration(Server-side).
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport" />
</binding>
</basicHttpBinding>
<basicHttpsBinding>
<binding name="httpsBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport" />
</binding>
</basicHttpsBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" bindingConfiguration="httpsBinding"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Feel free to let me know if the problem still exists.

WCF Issue: The remote server returned an error: (413) Request Entity Too Large

I know this question has been asked many time before, but unfortunately none of them resolved my issue.
I have a wcf web service in which i can send a file in form of bytes. If the size of the file is large(around 400 KB) this error comes. For small sized files, this issue is not coming. Following is my server endpoint configuration,
<service behaviorConfiguration="CPServicesBehaviour" name="ConsumerPortalAPI.ReceiveNoteService">
<endpoint address="" binding="customBinding" bindingConfiguration="CustomBinding_IReceiveNoteService" contract="ConsumerPortalAPI.IReceiveNoteService" />
</service>
The binding configuration is,
<binding name="CustomBinding_IReceiveNoteService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation" requireDerivedKeys="false" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
canRenewSecurityContextToken="true">
<secureConversationBootstrap defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</secureConversationBootstrap>
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</security>
<binaryMessageEncoding>
<readerQuotas maxDepth="32767" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="32767" maxNameTableCharCount="2147483647" />
</binaryMessageEncoding>
<httpsTransport />
</binding>
The default binding is,
<binding maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation" requireDerivedKeys="false" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
canRenewSecurityContextToken="true">
<secureConversationBootstrap defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</secureConversationBootstrap>
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</security>
<binaryMessageEncoding>
<readerQuotas maxDepth="32767" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="32767" maxNameTableCharCount="2147483647" />
</binaryMessageEncoding>
<httpsTransport />
</binding>
On my test client side the configuration is,
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_IReceiveNoteService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation" requireDerivedKeys="false" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
canRenewSecurityContextToken="true">
<secureConversationBootstrap defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</secureConversationBootstrap>
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</security>
<binaryMessageEncoding />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://cnsportal3.lineartitle.com/cnsAPI/v4/ReceiveNoteService.svc" binding="customBinding" bindingConfiguration="CustomBinding_IReceiveNoteService" contract="CPAction.IReceiveNoteService" name="CustomBinding_IReceiveNoteService" />
</client>
</system.serviceModel>
</configuration>
I tried increasing uploadReadAheadSize of my website to 10485759.
I also tried increasing maxAllowedContentLength of my website to 3000000000.
I checked the web trace on the server through system.diagnostics. Following is the Xml message that is logged in the trace,
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524326</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2015-01-21T11:01:33.3751197Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{90d52ffb-d886-4164-9d84-e74c04eb79b4}" />
<Execution ProcessName="w3wp" ProcessID="5916" ThreadID="16" />
<Channel />
<Computer>RES-DEV-WEB</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.GetServiceElement.aspx</TraceIdentifier>
<Description>Get ServiceElement.</Description>
<AppDomain>/LM/W3SVC/5/ROOT/cnsAPI/v4-2-130663116927511157</AppDomain>
<ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/ServiceConfigurationTraceRecord">
<FoundServiceElement>True</FoundServiceElement>
<ConfigurationFileSource>C:\inetpub\wwwroot\cnsportal3.lineartitle.com\ConsumerPortalAPI\v4\web.config</ConfigurationFileSource>
<ConfigurationFileLineNumber>133</ConfigurationFileLineNumber>
<ServiceConfigurationInformation>
<ServiceName>ConsumerPortalAPI.ReceiveNoteService</ServiceName>
<BehaviorConfiguration>CPServicesBehaviour</BehaviorConfiguration>
<Host>
<Timeouts>
<OpenTimeout>00:01:00</OpenTimeout>
<CloseTimeout>00:00:10</CloseTimeout>
</Timeouts>
</Host>
<Endpoints>
<Endpoint>
<Binding>customBinding</Binding>
<BindingConfiguration>CustomBinding_IReceiveNoteService</BindingConfiguration>
<Contract>ConsumerPortalAPI.IReceiveNoteService</Contract>
<ListenUriMode>Explicit</ListenUriMode>
</Endpoint>
</Endpoints>
</ServiceConfigurationInformation>
</ExtendedData>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
This seems that it is able to get the correct Binding Configuration but don't know why it is not using it.
P.S. All bindings are defined under customBinding tag.
Any help in this regard will be highly appreciated. Maybe there is something very small that i am missing here and any one of you can point me to the right direction.
Thanks in advance.
I was able to fix the issue by adding following line in my binding configurations.
<httpsTransport maxReceivedMessageSize="2147483647"/>
The whole binding configuration now looks as,
<binding name="CustomBinding_IReceiveNoteService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation" requireDerivedKeys="false" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" canRenewSecurityContextToken="true">
<secureConversationBootstrap defaultAlgorithmSuite="Default" authenticationMode="UserNameOverTransport" requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</secureConversationBootstrap>
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</security>
<binaryMessageEncoding>
<readerQuotas maxDepth="32767" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="32767" maxNameTableCharCount="2147483647" />
</binaryMessageEncoding>
<httpsTransport maxReceivedMessageSize="2147483647"/>
</binding>

Configuration to Enable HTTPS WCF Web Service on an Azure Web Role

I’ve searched through several posts (here and here, for example) related to this area, but none seem to address this fairly straight forward scenario question: What Binding configurations should be used to configure an SSL enabled (e.g. https) WCF Web Service on an Azure Web Role: in the Web Role’s ServiceDefinition.csdef, the Web Service’s web.config and the client’s app.config?
I have configured the SSL cert for the service in the Azure Portal and in the Web Role’s ServiceConfiguration.csfg for https:// MyApp.cloudapp.net and this appears to be working fine.
When I browse to the service https:// myapp.cloudapp.net/WCFService.svc?wsdl , the metadata displays correctly. I can add a Service Reference to the service from a client, but when I call it, I get the exception: “There was no endpoint listening at https:// myapp.cloudapp.net/WCFService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.” Inner Exception: “The remote server returned an error: (404) Not Found”
The respective configuration files look like this:
ServiceDefinition.csdef :
<WebRole name="WCFServiceWebRole" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="HttpIn" endpointName="HttpIn" />
<Binding name="HttpsIn" endpointName="HttpsIn" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="8080" />
<InputEndpoint name="HttpsIn" protocol="https" port="443" certificate="MySSLCert" />
</Endpoints>
<Certificates>
<Certificate name="MySSLCert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
Web Service’s web.config :
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
The Client’s App.Config looks like this:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyWebService" >
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://myapp.cloudapp.net/MyWebService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyWebService"
contract="MyWebServiceServiceReference.IMyWebService"
name="BasicHttpBinding_IMyWebService" />
</client>
</system.serviceModel>
When I use SvcUtil to generate the binding configuration for the client, it generates:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyWebService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://myapp.cloudapp.net/MyWebService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyWebService"
contract="MyWebServiceServiceReference.IMyWebService" name="BasicHttpBinding_IMyWebService" />
</client>
</system.serviceModel>
Which then gives the exception when I call the web service: "The provided URI scheme 'https' is invalid; expected 'http'." So that doesn't seem to be the correct configuration either.
I’m sure this is just a matter of getting the right configuration in the three files above, but I can’t seem to find the correct combination anywhere, and so I would really appreciate if someone could call out what they should be.
Conor.
An Azure dev helped me figure out the answer to this, the problem was the omission of the Service node from the Web Service's web.config file. Here is the full set of configuration files required for this scenario in case it helps anyone else trying to achieve the same result (An SSL/HTTPS WCF Web Service implemented on an Azure Web Role:
ServiceDefinition.csdef :
<WebRole name="WCFServiceWebRole" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="HttpIn" endpointName="HttpIn" />
<Binding name="HttpsIn" endpointName="HttpsIn" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="8080" />
<InputEndpoint name="HttpsIn" protocol="https" port="443" certificate="MySSLCert" />
</Endpoints>
<Certificates>
<Certificate name="MySSLCert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
Web Service’s web.config :
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="" name="MyWebServiceNameSpace.MyWebService">
<endpoint bindingConfiguration="BasicHttpBinding" address="" binding="basicHttpBinding"
contract="MyWebServiceNameSpace.IMyWebService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
The Client’s App.Config looks like this:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyWebService" >
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://myapp.cloudapp.net/MyWebService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyWebService"
contract="MyWebServiceServiceReference.IMyWebService"
name="BasicHttpBinding_IMyWebService" />
</client>
</system.serviceModel>
Thanks, works for me too!
I made some changes removing the certificates section in the service definition.
<WebRole name="WCFServiceBizagiCloud" vmsize="Standard_D1_v2">
<Sites>
<Site name="Web">
<Bindings>
<!--<Binding name="Endpoint1" endpointName="Endpoint1" />-->
<Binding name="HttpIn" endpointName="HttpIn" />
<Binding name="HttpsIn" endpointName="HttpsIn" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
</ConfigurationSettings>
<Endpoints>
<!--<InputEndpoint name="Endpoint1" protocol="http" port="80" />-->
<InputEndpoint name="HttpIn" protocol="http" port="8080" />
<InputEndpoint name="HttpsIn" protocol="https" port="443" />
</Endpoints>
<!--<Certificates>
<Certificate name="MySSLCert" storeLocation="LocalMachine" storeName="My" />
</Certificates>-->
</WebRole>

SAML2 using Thinktecture and WCF

I'm setting up a SAML2 STS using Thinktecture IdentityServer and a WCF Service.
The idea is to have Thinktecture supply the Assertions that are then used in the WCF Service.
Now, I have it running all fine with SAML 11 Assertions - urn:oasis:names:tc:SAML:1.0:assertion
The assertions are something like this:
<saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="_4e06770b-7fa0-425f-a4f3-263710f135d7" Issuer="https://localhost:123" IssueInstant="2014-01-18T16:16:38.099Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
- <saml:Conditions NotBefore="2014-01-18T16:16:37.662Z" NotOnOrAfter="2014-01-18T16:26:37.662Z">
- <saml:AudienceRestrictionCondition>
<saml:Audience>https://localhost:44300/</saml:Audience>
</saml:AudienceRestrictionCondition>
</saml:Conditions>
- <saml:AttributeStatement>
- <saml:Subject>
- <saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod>
</saml:SubjectConfirmation>...
Now, the requirement is to use SAML2, not the previous version. So changing the Token type in Thinktecture is simple and the new Assertion generates fine and get's picked by the client just fine.
New SAML2 Assertion:
<Assertion ID="_f9c48402-857a-4cc3-8525-1af307ef3a01" IssueInstant="2014-01-18T16:32:18.038Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
<Issuer>https://localhost:123</Issuer>
- <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
- <SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
- <Reference URI="#_f9c48402-857a-4cc3-8525-1af307ef3a01">
- <Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>Nib1Bs9jy13unYShm08EcncqFsOS5IwVuWQ4tGoe4Pg=</DigestValue>
</Reference>
</SignedInfo> ...
But when we then try to consume the WCF by passing the new asertion we get the exception:
XmlException: Cannot read the token from the 'Assertion' element with the 'urn:oasis:names:tc:SAML:2.0:assertion' namespace for BinarySecretSecurityToken, with a '' ValueType. If this element is expected to be valid, ensure that security is configured to consume tokens with the name, namespace and value type specified
Here's an excerpt of WCF web.config:
...
<services>
<service name="testsys.RFD.FormManager.RFDFormManagerService" behaviorConfiguration="testsys.RFD.FormManagerBehavior">
<endpoint address="" binding="ws2007FederationHttpBinding" bindingConfiguration="ws2007FederationHttpBinding" contract="FormManager_PortType" />
</service>
</services>
<protocolMapping>
<!--<add scheme="http" binding="ws2007FederationHttpBinding" />
<add scheme="http" binding="ws2007FederationHttpBinding" />-->
<add binding="ws2007FederationHttpBinding" scheme="https" />
<add binding="wsHttpBinding" scheme="https" />
</protocolMapping>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ILoggerService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="65536" maxReceivedMessageSize="65536" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true" messageEncoding="Text">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<ws2007FederationHttpBinding>
<binding name="ws2007FederationHttpBinding">
<security mode="TransportWithMessageCredential">
<message establishSecurityContext="false" issuedKeyType="BearerKey">
<!-- issuedTokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"-->
<issuerMetadata address="https://localhost:123/adfs/services/trust/mex" />
</message>
</security>
</binding>
<binding name="">
<security mode="TransportWithMessageCredential">
<message>
<issuerMetadata address="https://localhost:123/adfs/services/trust/mex" />
</message>
</security>
</binding>
</ws2007FederationHttpBinding>
<wsHttpBinding>
<binding name="RFD_Binding_HTTP" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message negotiateServiceCredential="false" establishSecurityContext="false" />
</security>
</binding>
<binding name="wsHttpBinding_IRFDFormManager" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
<binding name="HttpBinding_IRFDFormManager" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
<binding name="WSHttpBinding_IRESTFormManager">
<security mode="None" />
</binding>
</wsHttpBinding>
...
<behavior name="testsys.RFD.FormManagerBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" httpsGetUrl="https://localhost:44300/RFDFormManager.svc" />
<serviceDebug includeExceptionDetailInFaults="true" />
<useRequestHeadersForMetadataAddress />
<serviceCredentials>
<serviceCertificate findValue="65A34BC197C2E1334D971613521D53D3B5B807FF" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
<issuedTokenAuthentication certificateValidationMode="None">
<!-- The X.509 certificate CN=localhost chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider -->
<allowedAudienceUris>
<add allowedAudienceUri="https://localhost:44300/" />
</allowedAudienceUris>
</issuedTokenAuthentication>
<clientCertificate>
<authentication certificateValidationMode="None" />
</clientCertificate>
</serviceCredentials>
<serviceAuthorization principalPermissionMode="Always" />
<serviceSecurityAudit auditLogLocation="Application" suppressAuditFailure="true" serviceAuthorizationAuditLevel="Failure" messageAuthenticationAuditLevel="Failure" />
</behavior>
...
<system.identityModel>
<identityConfiguration saveBootstrapContext="true">
<securityTokenHandlers>
<add type="System.IdentityModel.Tokens.Saml2SecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</securityTokenHandlers>
<audienceUris>
<!-- <add value="https://localhost:44300/" />-->
<add value="https://localhost:44300/" />
</audienceUris>
<!--Commented by Identity and Access VS Package-->
<!--<issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry"><authority name="https://localhost:123"><keys><add thumbprint="7C399B2EA330F507902C81280E77407242FF6916" /></keys><validIssuers><add name="https://localhost:123" /></validIssuers></authority></issuerNameRegistry>-->
<!--certificationValidationMode set to "None" by the the Identity and Access Tool for Visual Studio. For development purposes.-->
<!--<certificateValidation certificateValidationMode="None" />-->
<issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<trustedIssuers>
<!--<add thumbprint="7C399B2EA330F507902C81280E77407242FF6916" name="https://localhost:123" />-->
<add thumbprint="65A34BC197C2E1334D971613521D53D3B5B807FF" name="https://localhost:123" />
<add thumbprint="15abb1aef64def860ca543f54fc8dee222d49b86" name="https://localhost:123" />
</trustedIssuers>
</issuerNameRegistry>
<!--certificationValidationMode set to "None" by the the Identity and Access Tool for Visual Studio. For development purposes.-->
<certificateValidation certificateValidationMode="None" revocationMode="NoCheck" />
<!--revocationMode="NoCheck" should not be used to prod.-->
</identityConfiguration>
</system.identityModel>
<system.identityModel.services>
<federationConfiguration>
<cookieHandler requireSsl="true" />
<!--<wsFederation passiveRedirectEnabled="true" issuer="https://localhost:123/issue/wsfed" realm="https://localhost:44300" reply="https://localhost:44300" requireHttps="false" />-->
<wsFederation passiveRedirectEnabled="true" issuer="https://localhost:123/issue/wsfed" realm="https://localhost:44300/" reply="https://localhost:44300/" requireHttps="true" />
</federationConfiguration>
</system.identityModel.services>
...
So what we're doing wrong ?
I can't be bothered to go through your WCF configuration - especially since most of it is not related to the question.
You don't need to do anything "special" in WCF to consume SAML2 tokens - follows this simple sample - and then re-integrate into your application:
http://leastprivilege.com/2012/11/16/wcf-and-identity-in-net-4-5-external-authentication-with-ws-trust/

wsHttpBinding to WCF Service hosted in IIS throughput issue

I have a client application for load testing, which is used as payload generator. The application is a client to WCF service hosted in IIS with secure wsHttpBinding. In addition, the WCF service hosted in IIS is a middle tier which is also a client to another asynchronous WCF service hosted in Windows services using netTcpBinding.
While load testing I couldn't go beyond 10-12 requests per second. I have the right throttling configuration as shown below.
Here is my configuration for the application that is client to the service hosted in IIS
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service behaviorConfiguration="ews.behavior" name="ServiceLoadTest.ProcessLoadRequest">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="ews.search.netTcp" contract="ServiceLoadTest.IProcessLoadRequest" />
<endpoint address=""
binding="wsHttpBinding" bindingConfiguration="ews.wsHttp"
contract="EWSServiceLoadTest.IProcessLoadRequest" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:3300/load/" />
<add baseAddress="http://localhost:3301/load/" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="ews.search.netTcp" closeTimeout="00:05:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="1000" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2000" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32767" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
<binding name="ews.netTcp">
<security mode="None" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_ISearchData" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None" negotiateServiceCredential="false" />
</security>
</binding>
<binding name="ews.wsHttp" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://[dnsName]/SearchData/Search.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISearchData"
contract="SearchDataReference.ISearchData"
name="WSHttpBinding_ISearchData">
<identity>
<dns value="[dnsName]" />
</identity>
</endpoint>
</client>
<behaviors>
<serviceBehaviors>
<behavior name="ews.behavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true" />
<serviceThrottling maxConcurrentCalls="5000" maxConcurrentSessions="5000" maxConcurrentInstances="5000"/>
<serviceTimeouts transactionTimeout="00:05:00" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
And here is web.config file for WCF service hosted in IIS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus" />
</behaviorExtensions>
</extensions>
<services>
<service behaviorConfiguration="ews.behavior" name="SearchData">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="ews.secure.wsHttp"
behaviorConfiguration="FlatWsdlBehaviour" contract="Contracts.ISearchData">
<identity>
<dns value="[dnsname]" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://[dnsname]/SearchData/Search.svc" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="FlatWsdlBehaviour">
<wsdlExtensions location="https://[dnsname]/SearchData/Search.svc" singleFile="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ews.behavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpsGetEnabled="true" />
<serviceThrottling maxConcurrentCalls="5000" maxConcurrentSessions="5000" maxConcurrentInstances="5000" />
<serviceTimeouts transactionTimeout="00:05:00" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_AllAsync" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="5000"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="5000"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
</security>
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="ews.secure.wsHttp" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTimeout="00:05:00"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None" negotiateServiceCredential="false" />
</security>
</binding>
</wsHttpBinding>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_AllAsync" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:5536/NMVTISCheckForDataOnlineCallback"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_AllAsync"
contract="CheckForDataReference.IProcessCheckForDateOnlineAsync" name="NetTcpBinding_IProcessCheckDataOnlineAsync">
</endpoint>
<endpoint address="http://localhost:5525/NMVTISCheckForVinOnlineCallback"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_AllAsync"
contract="CheckForDataReference.IProcessCheckForDataOnlineAsync" name="WSDualHttpBinding_IProcessCheckDataOnlineAsync">
</endpoint>
</client>
</system.serviceModel>
<runtime>
<gcServer enabled="true" />
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
In order to improve the performance of a IIS hosted WCF service, you may need to adjust the application pool settings. The following code snippet shows an example configuration setting:
<system.web>
<applicationPool maxConcurrentRequestsPerCPU="x" maxConcurrentThreadsPerCPU="x" requestQueueLimit="x"/>
</system.web>
Refer to the following MSDN page for additional information:
http://msdn.microsoft.com/en-us/library/ee377050.aspx