나는 이것에 관해 많은 질문을 보았고, 하루를 연구하고 그것을 고치려고 노력했지만 나는 빈 그림을 그렸다.WCF + IIS6 + HTTPS + 기본 인증
HTTPS로 연결하고 기본 인증을 사용하는 서버에 WCF 서비스를 배포하려고합니다. 여기 내 서비스 web.config입니다
두 개의 숫자를 더하는 단일 메서드를 가진 매우 간단한 계산기를 사용하고 있습니다.
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" />
<customErrors mode="Off" />
</system.web>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="UsernameWithTransport">
<security mode="Transport">
<transport clientCredentialType="Basic" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="Service">
<endpoint address="https://myserver.mydomain.co.uk/CalculatorService"
binding="wsHttpBinding"
bindingConfiguration="UsernameWithTransport"
name="BasicEndpoint"
contract="TestCalculator" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
IIS 6.0에서는 기본 인증과 HTTPS가 필요합니다.
.svc 파일을 탐색 할 수 있으며 내 자격 증명을 묻습니다. 나는 그들을 제공하고 그것은 기본 페이지를 표시합니다. 그러나 그것은 :
당신은 서비스를 만들었습니다.
이 서비스를 테스트하려면 클라이언트를 만들어서 서비스를 호출해야합니다. 당신은 다음과 같은 구문을 사용하여 명령 줄에서 svcutil.exe에 도구를 사용하여이 작업을 수행 할 수 있습니다이 구성 파일 및 클라이언트 클래스가 포함 된 코드 파일을 생성합니다 http://myserver.mydomain.co.uk/CalculatorService/Service.svc?wsdl
svcutil.exe에. 두 파일을 클라이언트 응용 프로그램에 추가하고 생성 된 클라이언트 클래스 을 사용하여 서비스를 호출하십시오. 예 : ......
기본적으로 .wsdl의 경로는 http : //가 아닌 https : //이며 그 이유를 이해할 수없는 것 같습니다. .
이제 서비스 소비를 테스트하기 위해 C# 콘솔 응용 프로그램을 만들려고합니다. .svc 경로에 대한 참조를 직접 추가 할 수 없습니다. 루프가 돌아 다니면서 사용자 이름과 암호를 묻는 것입니다. .svc? wsdl에 대한 참조를 추가하면 작동하지만 HTTPS가 아닌 HTTP를 사용하려고하기 때문에 "호출 할 수없는 메소드"가 나타납니다.
희망이 충분합니다. 어떤 도움을 주셔서 감사합니다.
고맙습니다. – bgs264