Service WCF personnalisé - includeExceptionDetailInFaults
-
09-12-2019 - |
Question
J'ai un service WCF personnalisé que j'ai créé à l'aide de la boîte à outils CKS pour SharePoint.
Comment puis-je activer includeExceptionDetailInFaults
dans ces services ?
D'après ce que je comprends, lorsque j'utilise BasicHttpBindingServiceMetadataExchangeEndpoint
SharePoint crée les points de terminaison de manière dynamique ?
Alors, où puis-je activer les exceptions ?
Merci
MISE À JOUR
Je peux décorer la mise en œuvre du service avec [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
qui fonctionne, mais c'est préférable d'avoir ça en config ??
La solution
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
**<serviceDebug includeExceptionDetailInFaults="true" />**
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange