2

私はiis7.0を使用してwcfをホストしましたが、URLは次のとおりです。

https://example.com/CustPortal/CustomerService.svc

vs2008でサービス参照を追加すると、次のエラーが発生します。

The document at the url https://example.com/CustPortal/CustomerService.svc was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'There was an error downloading 'https://el-cust-port01/CustPortal/CustomerService.svc?disco'.'.
  - Unable to connect to the remote server
  - No connection could be made because the target machine actively refused it 59.37.71.86:443
- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'https://193.91.152.191/CustPortal/CustomerService.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
Metadata contains a reference that cannot be resolved: 'https://193.91.152.191/CustPortal/CustomerService.svc'.
Metadata contains a reference that cannot be resolved: 'https://193.91.152.191/CustPortal/CustomerService.svc'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

私のweb.configは

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="metadataBehavior">
          <serviceMetadata httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceCredentials>
            <serviceCertificate storeName="My"  x509FindType="FindBySubjectName" findValue="TESTCERT" storeLocation="LocalMachine"/>
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="metadataBehavior" name="EV.Services.CustomerService">
        <endpoint binding="wsHttpBinding" bindingConfiguration="wsHttpBindingConfig" contract="EV.Contracts.ICustomer" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBindingConfig">
          <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>
4

3 に答える 3

4

メタデータExcahnge(mex)エンドポイントも欠落していると思います。追加してみてください:

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

既存のエンドポイントの下。次の目的でWebブラウザを開くことができるはずです。

https://193.91.152.191/CustPortal/CustomerService.svc?wsdl

表示された実際のWSDLファイルを確認してください。

于 2011-09-13T16:37:53.270 に答える
0

あなたはそれを家でホストしていますか?エラーは基本的にあなたがIPアドレスに到達できないことを示しています、それは私ができます。これは、「natループバック」をサポートしていないルーターである可能性があるため、ネットワーク内から外部IPアドレスにアクセスすることはできません。ローカルIPアドレスで参照を追加してみてください。

于 2011-09-13T16:29:06.573 に答える
0

サーバーのホスト名とWebサービスのIPアドレスをローカルPCのhostsファイル(C:\ Windows \ System32 \ drivers \ etc \ hosts)に追加します

于 2016-03-15T07:57:56.073 に答える