在安装程序时,我在每台计算机上安装新证书,因此我需要使用证书编码值更新应用程序配置文件。
<client>
<endpoint address="http://localhost:4064/DOXFA/MDMFileAccess.svc/epMainFA"
binding="wsFederationHttpBinding" bindingConfiguration="epMainFA"
contract="FileAccessService.IAMICASFileAccessService" name="epMainFA">
<identity>
<certificate encodedValue="**encoded value..."** />
</identity>
</endpoint>
....
<client>
应用程序使用AbcService WCF服务执行一些操作。所以安装程序使用svcutil创建配置文件并提取证书编码值并将其放在应用程序配置文件中。
然而,svcutil现在没有生成任何配置文件。
svcutil.exe "http://localhost:4064/WebApp/Abc.svc?wsdl" /config:C:\wcf.config
Microsoft(R)服务模型元数据工具[Microsoft(R)Windows(R) Communication Foundation,Version 3.0.4506.648]版权所有(c) 微软公司。保留所有权利。
尝试从中下载元数据 'http:// localhost:4064 / WebApp / Abc.svc?wsdl'使用WS-Metadata Exchange 或DISCO。
错误:无法导入wsdl:binding详细信息:找不到可用的策略 备择方案。 XPath到错误源: // WSDL:定义[@的targetNamespace =的 'http://tempuri.org/'] / WSDL:结合[@名称= 'epAbc']
错误:无法导入wsdl:port详细信息:导入时出错 wsdl:wsdl:port依赖的绑定。 XPath到 WSDL:结合: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='epAbc'] XPath到错误源: // WSDL:定义[@的targetNamespace =的 'http://tempuri.org/'] / WSDL:服务[@名称= 'AbcService'] / WSDL:端口@名称= 'epAbc']
生成文件... C:\ AbcService.cs
web.config看起来像(修改过的)
<system.serviceModel>
<bindings>
<wsFederationHttpBinding>
<binding name="bindMainFederation" closeTimeout="00:05:00" openTimeout="00:05:00"
sendTimeout="00:10:00" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security>
<message>
<issuerMetadata address="http://*ADDRESS*/appID/appID.svc/mex">
<identity>
<dns value="ADOCMergeSTS.com" />
</identity>
</issuerMetadata>
</message>
</security>
</binding>
</wsFederationHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="bhFederatedIdentity" name="X.AbcService">
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="epAbc" binding="wsFederationHttpBinding"
bindingConfiguration="bindMainFederation" name="epAbc" contract="X.IAbcService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="bhFederatedIdentity">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug httpsHelpPageEnabled="false" includeExceptionDetailInFaults="true" />
<serviceTimeouts transactionTimeout="00:25:00" />
<serviceCredentials>
<serviceCertificate findValue="ADOCMergeService.com" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySubjectName" />
<issuedTokenAuthentication certificateValidationMode="PeerTrust">
<knownCertificates>
<add findValue="ADOCMergeSTS.com" storeLocation="LocalMachine"
storeName="TrustedPeople" x509FindType="FindBySubjectName" />
</knownCertificates>
</issuedTokenAuthentication>
</serviceCredentials>
<serviceAuthorization principalPermissionMode="None" serviceAuthorizationManagerType="X.AbcAuthorizationManager, x" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
答案 0 :(得分:0)
这是svcutil.exe的问题。我可以通过从另一台计算机恢复svcutil.exe来解决此问题。