Hi Foks.
I am new to WCF and am working on a project where I am building a WCF library that is called by a Web project (ASP.NET 2.03.5 / C#).
I have a few things going on here.
1) I have provided a compliment contract (IJSON) for my SOAP contracts (ISOAP) for my JSON web methods. 2) I have one contract, IFileTransferService, that handles file streaming.
Can you please take a look at my APP.CONFIG and WEB.CONFIG files and tell me if they look correct or if I am reproducing that which is in my App.Config in my Web.Config unnecessarily? If I am using a Service Library, do I really need to be doing things twice (declaring services, bindings, etc)? Does this look right?
Also, any other stylistic / constructive comments regarding what I have in side system.serviceModel is always appreciated.
Thanks for your time.
WEB.CONFIG
<system.serviceModel>
<client>
<endpoint name="MySOAPAuthEP"
address="http://localhost:1241/WebProj/auth.svc/soap"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="Project.WebAPI.Authentication.ISOAPAuthService" />
<endpoint name="MySOAPTradeEP"
address="http://localhost:1241/WebProj/trade.svc/soap"
binding="basicHttpBinding"
bindingConfiguration="soapWeb"
contract="Project.WebAPI.Trade.ISOAPTradeService" />
<endpoint name="MySOAPFileTransferEP"
address="http://localhost:1241/WebProj/filetransfer.svc/soap"
binding="basicHttpBinding"
bindingConfiguration="httpLargeDataStream"
contract="Project.WebAPI.FileTransfer.ISOAPFileTransferService" />
<endpoint name="MyJSONAuthEP"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="Project.WebAPI.Authentication.IJSONAuthService" />
<endpoint name="MyJSONTradeEP"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="Project.WebAPI.Trade.IJSONTradeService" />
<endpoint name="MyJSONFileTransferEP"
binding="webHttpBinding"
bindingConfiguration="jsonWeb"
contract="Project.WebAPI.FileTransfer.IJSONFileTransferService" />
</client>
<bindings>
<basicHttpBinding>
<binding name="soapWeb" />
<binding name="httpLargeDataStream" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" maxBufferSize="65536"
maxReceivedMessageSize="2147483647" messageEncoding="Mtom" transferMode="Streamed">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="jsonWeb" maxBufferSize="1500000" maxBufferPoolSize="1500000"
maxReceivedMessageSize="1500000">
<readerQuotas maxDepth="32" maxStringContentLength="656000" maxArrayLength="656000"
maxBytesPerRead="656000" maxNameTableCharCount="656000" />
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="WebHttpEPBehavior">
<webHttp />
</behavior>
<behavior name="BasicHttpEPBehavior" />
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service behaviorConfiguration="Default" name="Project.WebAPI.Trade.TradeService">
<endpoint address="json" behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding" name="MyJSONTradeEP" contract="Project.WebAPI.Trade.IJSONTradeService" />
<endpoint address="soap" binding="basicHttpBinding" name="MySOAPTradeEP"
contract="Project.WebAPI.Trade.ISOAPTradeService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1243/WebProj/trade.svc" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="Default" name="Project.WebAPI.Authentication.AuthService">
<endpoint address="json" behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding" name="MyJSONAuthEP" contract="Project.WebAPI.Authentication.IJSONAuthService" />
<endpoint address="soap" binding="basicHttpBinding" name="MySOAPAuthEP"
contract="Project.WebAPI.Authentication.ISOAPAuthService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1242/WebProj/auth.svc" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="Default" name="Project.WebAPI.FileTransfer.FileTransferService">
<endpoint address="json" behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding" name="MyJSONFileTransferEP" contract="Project.WebAPI.FileTransfer.IJSONFileTransferService" />
<endpoint address="soap"
binding="basicHttpBinding"
name="MySOAPFileTransferEP"
bindingConfiguration="httpLargeDataStream"
contract="Project.WebAPI.FileTransfer.ISOAPFileTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1244/WebProj/filetransfer.svc" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
APP.CONFIG
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="soapWeb" />
<binding name="httpLargeDataStream"
maxReceivedMessageSize="2147483647"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
transferMode="Streamed"
messageEncoding="Mtom"
maxBufferSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="jsonWeb" maxBufferSize="1500000" maxBufferPoolSize="1500000"
maxReceivedMessageSize="1500000">
<readerQuotas maxDepth="32" maxStringContentLength="656000" maxArrayLength="656000"
maxBytesPerRead="656000" maxNameTableCharCount="656000" />
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="Default" name="Project.WebAPI.Trade.TradeService">
<endpoint address="json" behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding" name="MyJSONTradeEP" contract="Project.WebAPI.Trade.IJSONTradeService" />
<endpoint address="soap" binding="basicHttpBinding" name="MySOAPTradeEP"
contract="Project.WebAPI.Trade.ISOAPTradeService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1243/WebProj/trade.svc" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="Default" name="Project.WebAPI.Authentication.AuthService">
<endpoint address="json" behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding" name="MyJSONAuthEP" contract="Project.WebAPI.Authentication.IJSONAuthService" />
<endpoint address="soap" binding="basicHttpBinding" name="MySOAPAuthEP"
contract="Project.WebAPI.Authentication.ISOAPAuthService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1242/WebProj/auth.svc" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="Default" name="Project.WebAPI.FileTransfer.FileTransferService">
<endpoint address="json" behaviorConfiguration="WebHttpEPBehavior"
binding="webHttpBinding" name="MyJSONFileTransferEP" contract="Project.WebAPI.FileTransfer.IJSONFileTransferService" />
<endpoint address="soap" binding="basicHttpBinding" name="MySOAPFileTransferEP"
contract="Project.WebAPI.FileTransfer.ISOAPFileTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:1244/WebProj/filetransfer.svc" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="WebHttpEPBehavior">
<webHttp />
</behavior>
<behavior name="BasicHttpEPBehavior" />
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>