WCF服务分析器错误,无法导入绑定';xxx和x27;从名称空间';http://tempuri.org/'
我有一个WCF服务,我正试图在我的服务器上的IIS中运行。然而,我不知道该怎么处理这个错误,我在谷歌搜索中找到的每一个补丁都不起作用。我错过了什么 错误消息:无法从命名空间导入绑定“…”http://tempuri.org/"WCF服务分析器错误,无法导入绑定';xxx和x27;从名称空间';http://tempuri.org/',wcf,iis-7,Wcf,Iis 7,我有一个WCF服务,我正试图在我的服务器上的IIS中运行。然而,我不知道该怎么处理这个错误,我在谷歌搜索中找到的每一个补丁都不起作用。我错过了什么 错误消息:无法从命名空间导入绑定“…”http://tempuri.org/" <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MyService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true">
<assemblies>
<add assembly="Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</assemblies>
</compilation>
</system.web>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="MyServiceBinding">
<security mode="Message">
<message clientCredentialType="Windows"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="MyService">
<endpoint binding="wsHttpBinding" behaviorConfiguration="webHttp" contract="MyService">
<identity>
<dns value="https://IPADDRESS:443"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp defaultOutgoingResponseFormat="Json" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="WCFWsHttpBindingHttps.MyServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="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>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<applicationSettings>
<MyService.Properties.Settings>
<setting name="MyService_MyOtherService_MyOtherService" serializeAs="String">
<value>http://path-to-service/MyOtherService.svc</value>
</setting>
</MyService.Properties.Settings>
</applicationSettings>
</configuration>
http://path-to-service/MyOtherService.svc
[编辑]我应该注意,在我引用的另一个服务上从IIS托管服务时出现错误。它点击WSDL的第1行并抛出解析错误。只需查看web.config
- 服务名称和合同是相同的,虽然可能,但不是最佳实践
- 服务名称应该是完全限定的(包括名称空间)
- 您定义的服务行为未被您的服务元素引用(应添加
)behaviorConfiguration=“wcfwshtpbindinghttps.MyServiceBehavior”
- 您应该设置
,以便返回正确的错误消息serviceDebug includeExceptionDetailInFaults=“true”