2012-03-20 5 views
0

IISでSSL証明書を使用してWCFサービスを作成しました。私はそれのページを見ることができるが、私はそれを消費することはできません。どちらかといえば、ウェブサイトからwsdlを開くには何も起こりません。私は、クライアントからサービス参照を作成しようとすると、私はエラーサービスからWSDLを読み取ることができません

Metadata contains a reference that cannot be resolved: ' https://win-1bmal4qsmmk/IPagac/LegalEntityApplicationService.svc?wsdl '.
The document format is not recognized (the content type is 'text/html; charset=UTF-8'). Metadata contains a reference that cannot be resolved: ' https://win-1bmal4qsmmk/IPagac/LegalEntityApplicationService.svc?wsdl '. There was no endpoint listening at https://win-1bmal4qsmmk/IPagac/LegalEntityApplicationService.svc?wsdl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found. If the service is defined in the current solution, try building the solution and adding the service reference again.

enter image description here

web.configファイル、Webサイトのルートに

<?xml version="1.0"?> 
<configuration> 
    <connectionStrings> 
    <add name="DPMembershipConnection" connectionString="Data Source=localhost; Initial Catalog=data; Integrated Security=True; Pooling=False" providerName="System.Data.SqlClient" /> 
    </connectionStrings> 
    <system.web> 
    <roleManager enabled="true" defaultProvider="DPRoleManager"> 
     <providers> 
     <add name="DPRoleManager" type="System.Web.Security.SqlRoleProvider" connectionStringName="DPMembershipConnection" applicationName="/" /> 
     </providers> 
    </roleManager> 
    <authentication mode="Forms" /> 
    <compilation debug="true" targetFramework="4.0" /> 
    <membership defaultProvider="DPMembership"> 
     <providers> 
     <add applicationName="/" connectionStringName="DPMembershipConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="4" name="DPMembership" passwordStrengthRegularExpression="" type="System.Web.Security.SqlMembershipProvider" /> 
     </providers> 
    </membership> 
    </system.web> 
    <system.serviceModel> 
    <bindings> 
     <ws2007HttpBinding> 
     <binding name="BindingName"> 
      <security mode="TransportWithMessageCredential"> 
      <transport clientCredentialType="None" /> 
      <message clientCredentialType="UserName" /> 
      </security> 
     </binding> 
     </ws2007HttpBinding> 
    </bindings> 
    <services> 
     <service name="ApplicationContract.WCFContract.LegalEntityApplicationService"> 
     <endpoint address="https://localhost/IPagac/LegalEntityService.svc" 
      behaviorConfiguration="NewBehavior0" binding="ws2007HttpBinding" 
      bindingConfiguration="BindingName" name="Endpoint" contract="ApplicationContract.WCFContract.ILegalEntityApplicationService" /> 
     </service> 
    </services> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="NewBehavior0" /> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name=""> 
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
      <serviceAuthorization principalPermissionMode="UseAspNetRoles" 
      roleProviderName="AspNetSqlRoleProvider" /> 
      <serviceCredentials> 
      <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" 
       membershipProviderName="AspNetSqlMembershipProvider" /> 
      </serviceCredentials> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false"/> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 

SVCファイルを持っ

<% @ServiceHost 
Debug="true" 
Language="C#" 
Factory="DP.IPagac.Application.LegalEntityServiceHostFactory" 
Service="ApplicationContract.ProgramLayerContract.LegalEntityApplicationService" %> 
+0

「いいえ、エンドポイントのリスニングは、」あなたが解決するために必要なものです。それはサービスが実行されていないようです。 –

+0

しかし、ページを開くことができるiamは、エクスプローラで.svcで終わります。それはそれが実行されていることを意味しますか?またはもっと行う必要がありますか? – Ivan

+0

WindowsエクスプローラまたはInternet Explorer?また、ページがキャッシュされている可能性があります。 –

答えて

0

httpsには、

と入力してください
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" /> 

私が何かを忘れていない限り、消費者にwsdlを提供するmexエンドポイントはありません(エラーで指定されています)。 追加 MEXエンドポイントのような提供:

<services> 
    <service name="ApplicationContract.WCFContract.LegalEntityApplicationService">  
     <endpoint address="https://localhost/IPagac/LegalEntityService.svc"  
      behaviorConfiguration="NewBehavior0" binding="ws2007HttpBinding"  
      bindingConfiguration="BindingName" name="Endpoint"  
      contract="ApplicationContract.WCFContract.ILegalEntityApplicationService" />  

     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 

    </service> 
</services> 
+0

私はエンドポイントを追加しましたが、変更はありません。しかし、答えをありがとう – Ivan

関連する問題