2011-03-08 2 views
0
내가있는 wsHttpBinding 엔드 포인트에서 WCF 서비스를 노출하는 것을 시도하고있다

을 사용하고 있습니다 비록 오류 메시지가은 BasicHttpBinding와 관련된 그것은 나에게 다음과 같은 오류 메시지가 제공하기 :는 내가있는 wsHttpBinding

계약이 세션이 필요합니다,하지만 바인딩 'BasicHttpBinding'이 지원하지 않습니다. 을 지원하도록 올바르게 구성되지 않았습니다.

다음
[ServiceContract(Namespace="http://server.com/orderservices/",SessionMode=SessionMode.Required)] 
public interface IOrderService 
{ 
    [OperationContract(IsInitiating=true,IsTerminating=false)] 
    string GetOrderNumber(); 

    [OperationContract(IsInitiating = false, IsTerminating = true)] 
    void CreateOrder(string orderXML); 
} 

내 web.config 파일 (서비스가 IIS 7에서 호스팅되는)입니다 : 여기

인터페이스입니다

당신이 당신의 서비스 인터페이스 I를 게시 한 경우
<system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="longTimeoutBinding" 
      receiveTimeout="00:10:00" sendTimeout="00:10:00"> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service name="eMidWare.OrderService"> 
     <host> 
      <baseAddresses> 
       <add baseAddress = "http://localhost/" /> 
      </baseAddresses> 
     </host> 
     <!-- Service Endpoints --> 
     <endpoint 
      address="" 
      binding="wsHttpBinding" bindingConfiguration="longTimeoutBinding" 
      contract="eMidWare.IPricingDataService"> 
     </endpoint> 
     <endpoint 
      address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceDebug includeExceptionDetailInFaults="True" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
</system.serviceModel> 
+0

.NET 4? ? –

+0

@marc_s, yes .NET 4에 있습니다. – Attilah

+1

@marc_s .svc 파일을 가리키는 브라우저를 사용하여 로컬로 서비스에 액세스 할 수도 없습니다. – Attilah

답변

2

은 흠 .... 당신의 서비스 계약을 확인 - 그것은

[ServiceContract(Namespace="http://server.com/orderservices/",SessionMode=SessionMode.Required)] 
public interface IOrderService 
{ 
} 

하지만 설정에 IOrderService

, 당신은 따라서 eMidWare.IPricingDataService

<endpoint 
    address="" 
    binding="wsHttpBinding" bindingConfiguration="longTimeoutBinding" 
    contract="eMidWare.IPricingDataService"> 

에 대한 엔드 포인트를 설정하는, 난, 생각 .NET/WCF 4는 기본적으로 http:// 구성표의 경우 basicHttpBinding입니다.

+0

감사합니다. WCF 4가 기본 종점에서 시작된다는 사실에 당신이 옳았습니다. – Attilah

0

확실하게 말할 수 있었지만 귀하의 서비스 인터페이스에 다음과 같은 것이 있다고 생각합니다.

[ServiceContract(SessionMode = SessionMode.Required)] 

이것은 세션이 필요하고 BasicHttpBinding은 지원하지 않습니다. 세션이 필요할 경우 wsHttpBinding을 사용해야합니다.

+0

문제는 basicHttpBinding이 아니라 구성 파일에서 wsHttpBinding을 사용하고 있다는 것입니다. 당신은 위의 web.config에서 볼 수 있습니다. – Attilah

+0

.svc 파일은 어디에 있습니까? – Aliostad

+0

.svc 파일은 c : \ inetpub 디렉토리에 있습니다. – Attilah

관련 문제