<?xml version="1.0"?>
   <configuration>
  <configSections>
  <sectionGroup name="system.web.extensions"type="System.Web.Configuration.SystemWebExtensionsSectionGroup,     System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35">
    <sectionGroup name="scripting"type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35">
   <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
 sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
     <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
           <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
   <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup></sectionGroup>
     </configSections>
      <appSettings>
       <add key="LogFolderPath" value="C:\USERS"/>
      </appSettings>
      <connectionStrings>
       <add name="SqlServerConnectionString" connectionString="" />
       <add name="CT" connectionString="" />
        </connectionStrings>

      <system.serviceModel>
       <behaviors>
        <serviceBehaviors>
        <behavior name="serviceBehavior">
       <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
        <serviceDebug includeExceptionDetailInFaults="false"/>
         </behavior>
        </serviceBehaviors>
          <endpointBehaviors>
          <behavior name="web">
           <webHttp /></behavior>
            </endpointBehaviors>
            </behaviors>
            <services>
             <service name="Implementation.Service"behaviorConfiguration="serviceBehavior">
     <endpoint address="" binding="webHttpBinding" contract="Contract.IService"behaviorConfiguration="web"  bindingConfiguration="webHttpBinding"></endpoint>
       <endpoint address="mex" binding="mexHttpBinding"contract="IMetadataExchange" />
     </service>
      </services>
    <bindings>
     <basicHttpBinding>
      <binding name="CodeItSoap" closeTimeout="00:01:00" openTimeout="00:01:00"receiveTimeout="00:10:00"sendTimeout="00:01:00"allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"maxBufferSize="65536"maxBufferPoolSize="524288"maxReceivedMessageSize="65536"messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"useDefaultWebProxy="true">
  <readerQuotas maxDepth="32" maxStringContentLength="8192"maxArrayLength="16384"maxBytesPerRead="4096"maxNameTableCharCount="16384" />
    <security mode="TransportCredentialOnly">
     <transport clientCredentialType="Basic" />
    </security>
     </binding>
        </basicHttpBinding>
          <webHttpBinding>
          <binding name="webHttpBinding" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00 sendTimeout="00:01:00"allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"useDefaultWebProxy="true">
         <readerQuotas maxDepth="2147483647"maxStringContentLength="2147483647"maxArrayLength="2147483647"maxBytesPerRead="2147483647"maxNameTableCharCount="2147483647" />
    <security mode="TransportCredentialOnly">
    <transport clientCredentialType="Basic" proxyCredentialType="None"realm="">
      </transport>
       </security></binding>
        </webHttpBinding>
          </bindings>
           <client>
          <endpoint address="https://******.****-***.com/*****_*****_ws.do?SOAP"
        binding="basicHttpBinding" bindingConfiguration="CodeItSoap"
           contract="PulseService.CodeItSoap" name="CodeItSoap" />
            </client>
           </system.serviceModel>
            <system.webServer>
              <modules runAllManagedModulesForAllRequests="true">
               <remove name="ScriptModule"/>
                <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral,PublicKeyToken=31BF3856AD364E35"/>
              </modules>
         <validation validateIntegratedModeConfiguration="false"/>
            <handlers>
               <remove name="WebServiceHandlerFactory-Integrated"/>
           <remove name="ScriptHandlerFactory"/>
             <remove name="ScriptHandlerFactoryAppServices"/>
         <remove name="ScriptResource"/>
              <add name="ScriptHandlerFactory" verb="*" path="*.asmx"preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory,System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler,System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>            </handlers>
             </system.webServer><system.codedom>
              <compilers>
            <compiler language="c#;cs;csharp" extension=".cs"type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"><providerOption name="CompilerVersion" value="v3.5"/>
             <providerOption name="WarnAsError" value="false"/>
             </compiler></compilers>
             </system.codedom>
              <runtime>
                 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v2.0.50727">
                      <dependentAssembly>
                    <assemblyIdentity name="System.Web.Extensions"publicKeyToken="31bf3856ad364e35"/>
           <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
               <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design"publicKeyToken="31bf3856ad364e35"/>
          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
           </dependentAssembly>
            </assemblyBinding>
              </runtime>
               </configuration>

I am getting the following error when i run the .svc file"Security settings for this service require 'Basic' Authentication but it is not enabled for the IIS application that hosts this service". I know i have to enable the basic authentication in iis .I have a different login & password for the service (not windows login)so for that in client side i added this code var client = new WCFClientReference.WebService1SoapClient(); client.ClientCredentials.UserName.UserName = @"[DOMAIN[USERNAME]"; client.ClientCredentials.UserName.Password = @"[PASSWORD]"; do i need to write function in the client to consume the username & password ??And what changes should i make in the web config file & where to add the username & password in the web config??

Related posts

Recent Viewed