我创建了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
好的,请看下面的答案。 –