Servizio WCF personalizzato - includeexceptionDetailInfaults
-
09-12-2019 - |
Domanda
Ho un servizio WCF personalizzato che ho creato usando il toolkit CKS per SharePoint.
Come posso abilitare includeExceptionDetailInFaults
in questi servizi?
Il modo in cui lo capisco è, quando si utilizza BasicHttpBindingServiceMetadataExchangeEndpoint
SharePoint crea dinamicamente gli endpoint?
Allora, dove ho abilitato le eccezioni?
THX
Aggiornamento
Posso decorare l'implementazione del servizio con [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
che funziona, ma è preferibile avere questo in configurazione ??
Soluzione
<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>
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange