2008-10-03 8 views
12

우리 서버 중 하나의 Windows 서비스에서 WCF 서비스를 호스팅하고 있습니다. basicHttpBinding에서 작동시키고 .NET에서 테스트 클라이언트를 작성한 후 (결국 마침내) 나는 SoapClient 클래스를 사용하여 PHP에서 액세스하려고했습니다. 최종 소비자는 PHP 사이트가 될 것이므로 PHP로 소비 할 수 있어야합니다.Windows 서비스 내에서 호스팅되는 WCF 서비스 (basicHttpBinding)의 WSDL URL

PHP 코드에서 SoapClient 클래스의 생성자에 WSDL URL을 입력해야 할 때 나는 혼란 스러웠습니다. WSDL은 어디에 있습니까? 내가 가진 모든이다 : 이러한

http://172.27.7.123:8000/WordServicehttp://172.27.7.123:8000/WordService/mex

없음 WSDL을 노출하지 않습니다.

WCF에서 초보자 인 나는 어리석은 것을 물었을 수도있다. (어딘가에 잘못된 가정을했을 수도있다.) 부드러운하십시오 : D

그리고 아니, http://172.27.7.123:8000/WordService?wsdl 내가 IIS에서 호스트 강제 건가요 http://172.27.7.123:8000/WordService :(

다른 아무것도 표시되지 않습니다을 나는 일반 WebService를를 사용하도록 강요하고 있습니까

+0

니스. 검색 덕분에 질문과 대답이 발견되었습니다. –

답변

9

이 도움이 될 :

http://msdn.microsoft.com/en-us/library/ms734765.aspx

요약하면 서비스 끝점과 동작을 구성해야합니다. 다음은 최소한의 예입니다.

<system.serviceModel> 
    <services> 

    <service 
     <!-- Namespace.ServiceClass implementation --> 
     name="WcfService1.Service1" 

     <!-- User behaviour defined below --> 
     behaviorConfiguration="SimpleServiceBehaviour"> 

     <endpoint 
     address="" 
     binding="basicHttpBinding" 
     <!-- Namespace.Interface that defines our service contract --> 
     contract="WcfService1.IService1"/> 

    </service> 
    </services> 
    <behaviors> 
    <serviceBehaviors> 
     <behavior name="SimpleServiceBehaviour"> 

     <serviceMetadata 
      <!-- We allow HTTP GET --> 
      httpGetEnabled="true" 

      <!-- Conform to WS-Policy 1.5 when generating metadata --> 
      policyVersion="Policy15"/> 

     </behavior> 
    </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 

XML 주석은 유효하지 않은 위치에서 삭제해야합니다.

+2

죄송하지만 링크가 깨진 것 같습니다. –

+0

@Andrei : 링크가 잘된 것처럼 보입니다. MSDN은 주말 업그레이드 중 하나 였을 수도 있습니다. – Kev

+0

고마워, 지금 그것은 작동한다 :) –

1

참조하십시오? 이 링크 :

Exposing a WCF Service With Multiple Bindings and Endpoints

 
Unlike previous ASMX services, the WSDL (web service definition language) for WCF 
services is not automatically generated. The previous image even tells us that 
"Metadata publishing for this service is currently disabled.". 
This is because we haven't configured our service to expose any meta data about it. 
To expose a WSDL for a service we need to configure our service to provide meta information. Note: 
The mexHttpBinding is also used to share meta information about a service. While 
the name isn't very "gump" it stands for Meta Data Exchange. 
+0

감사합니다. - 지적한 문서에서도 httpGetEnabled가 true로 설정되어 있습니다. –

관련 문제