我創建了WCF服務並且Web.Config文件具有以下設置。在ServiceModel客戶端配置部分中找不到引用合同的默認端點元素
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" sendTimeout="10:00:00" openTimeout="10:00:00">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Axis.OptimizationService.RMSCalculationService">
<endpoint address="" binding="basicHttpBinding" contract="Axis.RMS.Optimization.Contracts.IRMSCalculationService"></endpoint>
</service>
</services>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0"/>
在我的ClassLibrary項目,我已經創建Servcie參考的名稱CatpricingService和app.config文件看起來如下。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IRMSCalculationService" closeTimeout="00:30:00"
openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="01:00:00"
maxBufferPoolSize="0" maxReceivedMessageSize="2147483647"
useDefaultWebProxy="true" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:2200/RMSCalculationService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRMSCalculationService"
contract="CatPricingService.IRMSCalculationService" name="BasicHttpBinding_IRMSCalculationService" />
</client>
我不知道我在做什麼錯在這裏。我做了幾次。我無法弄清楚錯誤是什麼。對我來說,所有的設置都是正確 我收到此錯誤。
Could not find default endpoint element that references contract 'CatPricingService.IRMSCalculationService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
我提到了關於Stackoverflow的其他問題.....我堅持這一點。 任何人都可以弄清楚我的設置有什麼問題嗎?
這裏我的ClassLibrary項目運行時使用外部程序excel.exe。 (項目屬性,調試選項卡,選擇 「啓動外部程序」,並給價值C:\ Program Files文件\的Microsoft Office \ OFFICE14 \ EXCEL.EXE
感謝
你提到了app.config,這個app.config是在你的ClassLibrary項目中還是在另一個引用你的ClassLibrary的項目中? –
此app.config文件僅在ClassLirary項目中。 – Ritha
好的,請看下面的答案。 –