Search code examples
asp.net-mvcwcfsoapasmx

Does WCF works as SOAP by default?


Does WCF works as SOAP by default ?

As per client requirement, wanted to use ASMX web services. But VS 2013 not providing ASMX web services (SOAP) under 4.5.1 framework. So can I use WCF as SOAP? and How ?


Solution

  • yes you can you WCF as SOAP you only need to add the bindings in client and server side you the basicHttpBinding binding

    server side

    <services>
      <service name="TestService">
        <endpoint address="soap" binding="basicHttpBinding" contract="ITestService"/>  
      </service>
    </services>
    

    client side add the service reference to your project

    <client>
        <endpoint address="http://www.example.com/soap" binding="basicHttpBinding"
          contract="ITestService" name="BasicHttpBinding_ITestService" />
      </client>