2012-08-02 87 views
0

在安裝程序的時候,我在每臺機器上都安裝了新的證書,所以我需要用證書編碼值更新應用程序配置文件。svcutil沒有生成配置文件

<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) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648] Copyright (c) Microsoft Corporation. All rights reserved.

Attempting to download metadata from 'http://localhost:4064/WebApp/Abc.svc?wsdl' using WS-Metadata Exchange or DISCO.

Error: Cannot import wsdl:binding Detail: Cannot find usable policy alternatives. XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='epAbc']

Error: Cannot import wsdl:port Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on. XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='epAbc'] XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='AbcService']/wsdl:[email protected]='epAbc']

Generating files... 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

這與svcutil.exe的一個問題。我能夠通過從另一臺機器還原svcutil.exe來解決此問題。