2012-03-24 13 views
9

मैं अपने डब्ल्यूसीएफ वेब आधारित सेवा - wsHttp और netTcp में दो अंतराल शामिल करने की कोशिश कर रहा हूं। Web.config में दिखाया गया है नीचे मैं उन्हें जोड़ लिया है, लेकिन मेरे वेब ब्राउज़र में Service.svc पर जब जब मैं संकलन निम्न त्रुटि प्राप्त और क्लिक करें:system.serviceModel/bindings/wsHttp बाइंडिंग पर बाध्यकारी नहीं है ... त्रुटि

त्रुटि पृष्ठ:

Server Error in '/MyService' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding named 'wsHttpBinding'. This is an invalid value for bindingConfiguration. 

Source Error: 

Line 16: </baseAddresses> Line 17:   </host> Line 18: <endpoint address="http://localhost:8090/Services/MyService" Line 19:     binding="wsHttpBinding" Line 20:     bindingConfiguration="wsHttpBinding" 


Source File: C:\MyService\web.config Line: 18 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

वेब .config:

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="false" targetFramework="4.0" /> 
    </system.web> 
    <system.serviceModel> 
    <protocolMapping> 
     <add scheme="http" binding="wsHttpBinding"/> 
    </protocolMapping> 
    <services> 
     <service 
     name="Microsoft.ServiceModel.Samples.MyService"> 
     <host> 
      <baseAddresses> 
      <add baseAddress="net.tcp://localhost:9001/"/> 
      </baseAddresses> 
     </host> 
     <endpoint address="http://localhost:8090/Services/MyService" 
        binding="wsHttpBinding" 
        bindingConfiguration="wsHttpBinding" 
        name="MyService_WsHttp" 
        contract="Microsoft.ServiceModel.Samples.IService" /> 
     <endpoint address="net.tcp://localhost:9000/Services/MyService" 
        binding="netTcpBinding" 
        bindingConfiguration="tcpBinding" 
        name="MyService_Tcp" 
        contract="Microsoft.ServiceModel.Samples.IService" />  
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- 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> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 

</configuration> 

उत्तर

30

इस बाहर ले:

  bindingConfiguration="wsHttpBinding" 

यहां से:

address="http://localhost:8090/Services/MyService" 
        binding="wsHttpBinding" 
        bindingConfiguration="wsHttpBinding" 
+1

टी ... गु ... धन्यवाद! – Bob

+0

कृपया उत्तर के रूप में चिह्नित करें यदि इसका काम किया गया है - इसका कारण यह है कि यदि आप 'बॉक्स से बाहर' बाइंडिंग का उपयोग कर रहे हैं (जैसा कि आप हैं ...) तो आपने कोई कॉन्फ़िगरेशन परिवर्तन नहीं किया है - जो कि विशेषता है संकेत मिलता है। – Chris

+0

जब मैं wsHttp बाइंडिंग का उपयोग करता हूं, तो यह कहता है कि अनुबंध को DualHttp बाइंडिंग का उपयोग करना चाहिए? – Hari

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