2010-02-12 19 views
4

J'ai actuellement un service de reliure WCF webHttp contraignant, il fonctionne très bien sur http, je peux faire des messages de grandes tailles en raison de mes paramètres webconfig, maintenant j'essaie de l'utiliser sur https (ssl), maintenant mon travail fonctionne bien, mais mes messages ne le font pas, ça ne fonctionne pas quand la taille du fichier est supérieure à un certain montant, je me demandais pourquoi cela pourrait être puisque mon webconfig spécifie une taille plus grande et fonctionne bien sur http, ici est mon webconfig pertinente .. suggestionsProblème WCF avec les POST utilisant ssl (https)

Merci

<system.serviceModel> 
<client> 
    <endpoint binding="webHttpBinding" bindingConfiguration="webHttp" 
    contract="PrimeStreamInfoServices.IService1" name="Client" /> 
</client> 
<bindings> 
    <webHttpBinding> 
    <binding name="webHttp" maxBufferSize="15000000" maxBufferPoolSize="15000000" 
     maxReceivedMessageSize="15000000"> 
     <readerQuotas maxDepth="15000000" maxStringContentLength="10000000" 
     maxArrayLength="15000000" maxBytesPerRead="15000000" maxNameTableCharCount="10000000" /> 
     <security mode="None"> 
     <transport clientCredentialType="None" proxyCredentialType="None" 
      realm="string" /> 
     </security> 
    </binding> 
    </webHttpBinding> 
</bindings> 
<services> 
    <service behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior" 
    name="PrimeStreamInfoServices.Service1"> 
    <endpoint address="" binding="webHttpBinding" 
     bindingConfiguration="webHttp" contract="PrimeStreamInfoServices.IService1" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    </service> 
</services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="PrimeStreamInfoServices.Service1Behavior"> 
     <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="false" /> 
     <serviceCredentials> 
     <!-- 
     <serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="TempCa" /> 
      --> 
     </serviceCredentials> 

    </behavior> 
    </serviceBehaviors> 
</behaviors> 
<diagnostics> 

    <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true" 
    logMessagesAtTransportLevel="true" /> 

</diagnostics> 

Répondre

8

Si vous souhaitez utiliser webHttpBinding sur SSL, vous avez configurer la liaison à utiliser la sécurité du transport comme:

<security mode="Transport"> 

Cette link fournit quelques détails avec config exemple pour traiter l'erreur suivante:

Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https]

Exemple de configuration du blog:

<system.serviceModel> 
<behaviors>  
<endpointBehaviors> 
    <behavior name="TestServiceAspNetAjaxBehavior"> 
    <enableWebScript /> 
    </behavior> 
</endpointBehaviors> 
</behaviors> 
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 
<services> 
<service name="TestService"> 
    <endpoint address="" behaviorConfiguration="TestServiceAspNetAjaxBehavior" 
    binding="webHttpBinding" bindingConfiguration="webBinding" contract="TestService" /> 
</service> 
</services> 
<bindings> 
    <webHttpBinding> 
    <binding name="webBinding"> 
     <security mode="Transport"> 
     </security> 
    </binding> 
    </webHttpBinding> 
</bindings> 
</system.serviceModel>