2012-08-11 2 views
0

정말 간단한 WCF 서비스를 만들었지 만 어떤 이유인지 svcutil과 관련된 문제가 있습니다. 나는 다음과 같은 출력을 얻고있다WCF 서비스에서 메타 데이터를 가져 오는 중 오류가 발생했습니다.

svcutil http://localhost:8098/IceVSServer/service?wsdl 

:

Microsoft (R) Service Model Metadata Tool 
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1] 
Copyright (c) Microsoft Corporation. All rights reserved. 

Attempting to download metadata from 'http://localhost:8098/IceVsServer/service?wsdl' using WS-Metadata Exchange or DISCO. 
Microsoft (R) Service Model Metadata Tool 
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1] 
Copyright (c) Microsoft Corporation. All rights reserved. 

Error: Cannot obtain Metadata from http://localhost:8098/IceVsServer/service?wsdl 

If this is a Windows (R) Communication Foundation service to which you have acce 
ss, please check that you have enabled metadata publishing at the specified addr 
ess. For help enabling metadata publishing, please refer to the MSDN documentat 
ion at http://go.microsoft.com/fwlink/?LinkId=65455. 


WS-Metadata Exchange Error 
    URI: http://localhost:8098/IceVsServer/service?wsdl 

    Metadata contains a reference that cannot be resolved: 'http://localhost:8098/IceVsServer/service?wsdl'. 

There was no endpoint listening at http://localhost:8098/IceVsServer/service 
?wsdl that could accept the message. This is often caused by an incorrect addres 
s or SOAP action. See InnerException, if present, for more details. 

The remote server returned an error: (404) Not Found. 


HTTP GET Error 
    URI: http://localhost:8098/IceVsServer/service?wsdl 

There was an error downloading 'http://localhost:8098/IceVsServer/service?wsdl'. 

The request failed with HTTP status 404: Not Found. 

If you would like more help, type "svcutil /?" 

오류가 난 더 MEX 엔드 포인트가없는 나타내는 것 같다 나는 다음과 같은 명령을 사용하고 있습니다. 나는 실제로 브라우저에 URL을 입력하면 XML이 올바르게 작동한다. 당신은 Mex으로 HttpGet을 혼동

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
    <services> 
     <service name="IceVSService.IceVsService" behaviorConfiguration="IceVsServiceBehavior"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8098/IceVsService/service"/> 
      </baseAddresses> 
     </host> 
     <!-- this endpoint is exposed at the base address provided by host: http://localhost:8098/IceVsService/service --> 
     <endpoint address="" 
        binding="wsHttpBinding" 
        contract="IceVSService.IIceVersioningSystem" /> 
     <!-- the mex endpoint is explosed at http://localhost:8098/IceVsService/service/mex --> 
     <endpoint address="mex" 
        binding="mexHttpBinding" 
        contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="IceVsServiceBehavior"> 
      <serviceMetadata httpGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="False"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

답변

1

:

여기 내의 app.config입니다. 서비스 세부 정보를 게시하는 두 가지 방법은 "metadata exchange format"(MEX) 또는 "web service description language"(WSDL)입니다.

구성에 둘 다 정의했습니다. 그러나 당신은 httpgeturl 속성을 정의하지 않으므로 빈 문자열처럼 취급 될 것입니다. 이므로 wsdl 주소는 http://localhost:8098/IceVsService/service?wsdl 이 아니며 http://localhost:8098/IceVsServer/service이 아닙니다 (IceVsServer는 어디에도 정의되어 있지 않습니다).

귀하의 MEX 주소도는 svcutil와 함께 작동합니다 : http://localhost:8098/IceVsService/service/mex

+0

자네 말이 맞아 ... 그게 정확히이었다. 나는 시험해 보았다. 도와 주셔서 감사합니다 – Icemanind