WCF এর web.config ফাইল

WCF দিয়ে বিভিন্ন কনফিগারেশনে বিভিন্ন ডাটা ফর্ম্যাটে ডাটা পাঠানো যায়। ধরা যাক, আমরা TCP-REST, HTTP-SOAP ফর্ম্যাটে ডাটা পাঠাবো। তাহলে WCF এর WEB.CONFIG ফাইলটা এরকম হবে:

<system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    </serviceHostingEnvironment>
    <!--Set up the service-->

    <services>
      <service behaviorConfiguration="SOAPRESTDemoBehavior" name="HmlApi">
       <endpoint address="rest" binding="webHttpBinding" contract="VLSCore2.Interfaces.IHmlApi" behaviorConfiguration="RESTDemoEndpointBehavior" />
       <endpoint address="soap" binding="basicHttpBinding" contract="VLSCore2.Interfaces.IHmlApi" behaviorConfiguration="SOAPDemoEndpointBehavior" />
      </service>
    </services>

    <!--Define the behaviours-->
    <behaviors>
      <serviceBehaviors>
        <behavior name="SOAPRESTDemoBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>

     <endpointBehaviors>
    <behavior name="SOAPDemoEndpointBehavior">
      <ipFilter/>
    </behavior>
    <behavior name="RESTDemoEndpointBehavior">
      <ipFilter/>
      <webHttp />
    </behavior>
  </endpointBehaviors>
    </behaviors>

    <extensions>
      <behaviorExtensions>
        <add name="ipFilter" type="VLSCore2.Api.IpFilterBehaviourExtensionElement, VLSCore2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      </behaviorExtensions>
    </extensions>

  </system.serviceModel>


পোস্ট কৃতজ্ঞতা: http://stackoverflow.com/questions/7585363/why-does-my-wcf-service-give-the-message-does-not-have-a-binding-with-the-none

Leave a Reply

Your email address will not be published. Required fields are marked *