none
problem in access base64(in string formate) by wcf service using post method. RRS feed

  • Question

  • I deployed wcf restfull service using post method on iis6. Client is android who send base64 (in string formate). when i deploy on iis7 it's working fine. But in iis6 its give error 400 as it is Bad Request. I also changed my config. file setting but no any benefit. Bellow is my webconfig, if any missing is there please correct me. 

    <?xml version="1.0"?>
    <configuration>  
     <connectionStrings>
        <clear/>
        <add name="***" connectionString="Data Source=******;Initial Catalog=*****;User ID=****;Password=*****" providerName="MySql.Data.MySqlClient"/>    
          
        <add name="ConnectionString" connectionString="DSN=localhost;" providerName="System.Data.Odbc"/>
      </connectionStrings>
      <system.web>
       
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
            <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </assemblies>
        </compilation>
        
        <authentication mode="Windows"/>
       
       
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
      </system.web>
      
      <system.webServer>
        
        <directoryBrowse enabled="true"/>
      </system.webServer>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="ServiceBehaviour" name="Service">
            <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" contract="IService">
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviour">
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true"/>
             
              <serviceDebug includeExceptionDetailInFaults="false"/>
            </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
            <behavior name="web">
              <webHttp/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
      </system.serviceModel>
    </configuration>


    And i also tried all setting in web config such as given bellow

    <webHttpBinding>
        <binding 
            allowCookies="Boolean"
            bypassProxyOnLocal="Boolean"
            closeTimeout="TimeSpan"
            hostNameComparisonMode="StrongWildCard/Exact/WeakWildcard"
            maxBufferPoolSize="integer"
            maxBufferSize="integer"
            maxReceivedMessageSize="Integer"
            name="string"
            openTimeout="TimeSpan" 
            proxyAddress="URI"
            receiveTimeout="TimeSpan"
            sendTimeout="TimeSpan"
                    transferMode="Buffered/Streamed/StreamedRequest/StreamedResponse"
            useDefaultWebProxy="Boolean">
                    
    writeEncoding="UnicodeFffeTextEncoding/Utf16TextEncoding/Utf8TextEncoding"
            <security mode="None/Transport/TransportCredentialOnly">
                <transport clientCredentialType = 
                     "Basic/Certificate/Digest/None/Ntlm/Windows"
                      proxyCredentialType="Basic/Digest/None/Ntlm/Windows"
                      realm="string" />
            </security>
           <readerQuotas             maxArrayLength="Integer"            maxBytesPerRead="Integer"            maxDepth="Integer"             maxNameTableCharCount="Integer"                     maxStringContentLength="Integer" />
        </binding>
    </webHttpBinding>

    But not working. Give me a better suggestion , what i have to do. 

    Thanks

    Tuesday, February 5, 2013 11:43 AM

Answers