Serviço WCF personalizado - includeExceptionDetailInFaults
-
09-12-2019 - |
Pergunta
Eu tenho um serviço WCF personalizado que criei usando o kit de ferramentas CKS para SharePoint.
Como faço para habilitar includeExceptionDetailInFaults
nestes serviços?
Pelo que entendi é, ao usar BasicHttpBindingServiceMetadataExchangeEndpoint
O SharePoint cria os endpoints dinamicamente?
Então, onde eu habilitei exceções?
THX
ATUALIZAR
Posso decorar a implementação do serviço com [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
o que funciona, mas é preferível ter isso na configuração?
Solução
<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>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange