2013-03-06 14 views
7

यहाँ मैं अपने ब्राउज़रएंडपॉइंट डिस्पैचर पर कॉन्ट्रैक्टफिल्टर मेल नहीं खाता?

https://eshop/LinkService/LinkService.svc/GetStudentObj 

में होस्ट RESTful सेवा से विधि बोल रहा हूँ और निम्न त्रुटि

<system.serviceModel> 
    <services> 
     <service name="LinkService.LinkService" behaviorConfiguration="MyServiceBehavior"> 
     <endpoint address="" binding="webHttpBinding" bindingConfiguration="https" contract="LinkService.ILinkService" /> 
    <endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex" /> 
     </service> 
    </services> 
    <bindings> 
     <webHttpBinding> 
     <binding name="https"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" /> 
      </security> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="MyServiceBehavior"> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="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="true"/> 
     </behavior> 
     </serviceBehaviors> 
     <endpointBehaviors> 
     <behavior name="web"> 
      <webHttp/> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/> 
    <standardEndpoints> 
     <webHttpEndpoint> 
     <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/> 
     </webHttpEndpoint> 
    </standardEndpoints> 
    </system.serviceModel> 

और

public Student GetStudent() 
     { 
      Student stdObj = new Student 
      { 
       StudentName = "Bala", 
       Age = 29, 
       Mark = 95 
      }; 
      return stdObj; 

     } 
हो रही

The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None) 

कॉन्फ़िग फ़ाइल

और

[ServiceContract] 
    public interface ILinkService 
    { 
     [OperationContract] 
     [WebInvoke(Method = "GET", UriTemplate = "/GetStudentObj", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,ResponseFormat = WebMessageFormat.Json)] 
     Student GetStudent(); 
    } 

कोई सुझाव?

+0

क्या लायक है के लिए, यह [जवाब] (http://stackoverflow.com/a/31678625/1257607) उपयोगी – DanielV

उत्तर

14

जोड़ें व्यवहार विन्यास <endpoint address /> में टैग

<endpoint address="" binding="webHttpBinding" bindingConfiguration="https" contract="LinkService.ILinkService" behaviorConfiguration="web"/> 
+0

इस क्ष हो सकता है और एक परोक्ष रूप से मदद की मैं, तो चारों ओर इतना ऊपर उठाता है। – MrBoJangles

संबंधित मुद्दे