2013-06-25 3 views
1

바인딩 사이에 불일치가 있기 때문에메시지 토큰이 잘못되었거나 만료 된 보안 컨텍스트를 포함하거나 내가 Web.config를 사용하여 WCF 서비스를 소비하는 샘플 웹 응용 프로그램이

<system.serviceModel> 
    <bindings> 
    <wsHttpBinding> 
    <binding name="TheBindingConfig"> 
     <security mode="None" > 
     <transport clientCredentialType="None" /> 
    <message establishSecurityContext="false" />  
    </security> 
    </binding> 
    </wsHttpBinding> 
</bindings> 
    <client> 
     <endpoint address="http://localhost/myservice/Service.svc" 
     binding="wsHttpBinding" bindingConfiguration="TheBindingConfig" 
     contract="myservice.IService" name="WSHttpBinding_IService"> 
     <identity> 
      <dns value="localhost" /> 
     </identity> 
     </endpoint> 
    </client> 
    </system.serviceModel> 

및 WCF 서비스 구성 파일이 참고 서비스는 네임 스페이스로 작성되어

<system.serviceModel> 
     <services> 
      <service name="myservice.Service" behaviorConfiguration="ServiceBehavior"> 
       <!-- Service Endpoints --> 
       <endpoint address="" binding="wsHttpBinding" contract="myservice.IService"> 
        <!-- 
       Upon deployment, the following identity element should be removed or replaced to reflect the 
       identity under which the deployed service runs. If removed, WCF will infer an appropriate identity 
       automatically. 
      --> 
        <identity> 
         <dns value="localhost" /> 
        </identity> 
       </endpoint> 
       <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
      </service> 
     </services> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior name="ServiceBehavior"> 
        <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
        <serviceMetadata httpGetEnabled="true" /> 
        <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
        <serviceDebug includeExceptionDetailInFaults="false" /> 
       </behavior> 
      </serviceBehaviors> 
     </behaviors> 
    </system.serviceModel> 

다음과 같이 " MYSERVICE"

내가

The message could not be processed. This is most likely because the action 'http://tempuri.org/IService/GetUserDetails' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding. 

같은 오류 응답 및 스택 추적을 오전

[FaultException: The message could not be processed. This is most likely because the action 'http://tempuri.org/IService/GetUserDetails' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.] 
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +9439503 
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +345 
    sampleuserservice.IService.GetUserDetails(String Username) +0 
    sampleuserservice._Default.BindUserDetails() +57 
    sampleuserservice._Default.Page_Load(Object sender, EventArgs e) +90 
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 
    System.Web.UI.Control.OnLoad(EventArgs e) +91 
    System.Web.UI.Control.LoadRecursive() +74 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 

참고로 : 서비스가 제대로 위의 webconfig 파일

사이의 매핑 문제가있는 것 같아요

을 예상대로 실행

귀하의 소중한 응답과 성원을 기다리십시오.

+0

WCFTestClient 또는 SoapUI에서 서비스를 호출 할 때 서비스가 작동합니까? – MaxSC

+0

Visual Studio의 @ MaxS-Betclic WCF 테스트 클라이언트 – GowthamanSS

+0

@ MaxS-Betclic이 네임 스페이스가 작동 중임 – GowthamanSS

답변

0

서비스가 모든 종류의 클라이언트 (.net, soapui)에서 사용될 수 있고 작동중인 soap 요청 (headers + body)과 작동하지 않는 서비스를 게시 할 수 있습니다. fiddler 또는 wcf 로그를 사용하여 메시지를 가져올 수 있습니다. 서비스가 전혀 작동하지 않는다면 클라이언트가 보안을 전혀 사용하지 않도록 구성 되었기 때문에 (보안 모드 = "없음") 서버에 바인딩 구성이 없으므로 기본값이 사용되고 기본값은 사용됩니다. 거기에 보안이 있습니다.