Я новичок в WCF и работаю над проектом
где я строю библиотеку WCF, которая называется
веб-проектом (ASP.NET 2.03.5 / C #).
У меня здесь кое-что происходит.
1) Я предоставил контракт на комплимент (IJSON) для моего
Контракты SOAP (ISOAP) для моих веб-методов JSON.
2) У меня есть один контракт, IFileTransferService, который обрабатывает
потоковая передача файлов
Можете ли вы взглянуть на мои APP.CONFIG и WEB.CONFIG
файлы и скажите мне, если они выглядят правильно или я воспроизводить
то, что в моем App.Config в моем Web.Config без необходимости?
Если я использую сервисную библиотеку, мне действительно нужно делать
вещи дважды (объявление услуг, привязок и т. д.)? Это выглядит
право?
Кроме того, любые другие стилистические / конструктивные комментарии, касающиеся
То, что я имею в стороне system.serviceModel, всегда ценится.
Спасибо за ваше время.
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>