[Resolvido] Problemas com Silverlight e FaultExceptions.
Pessoal,
Estou tentando fazer com que o Silverlight 4 entenda o FaultExceptions, segui o respectivo link:
http://msdn.microsoft.com/en-us/library/dd470096%28VS.96%29.aspx .
Mas estou tendo problemas com a tag: <silverlightFaults/>, quando retiro a mesma consigo acessar o serviço perfeitamente, ao usar a mesma o seguinte erro é apresentado:
...
Parser Error Message: An error occurred creating the configuration section handler for system.serviceModel/behaviors: Extension element 'silverlightFaults' cannot be added to this element. Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions.
Parameter name: element
...
Segue abaixo o Web.config para uma melhor visualização:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="silverlightFaults"
type="Servico.SilverlightFaultBehavior,
Servico,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=null"/>
</behaviorExtensions>
</extensions>
<services>
<service name="Servico.Teste">
<endpoint address=""
binding="basicHttpBinding"
contract="Servico.Teste"
bindingConfiguration="Servico.Teste.customBinding0"/>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="Servico.Teste.customBinding0">
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="">
<silverlightFaults/> // TAG QUE GERA O PROBLEMA APRESENTADO ACIMA.
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
Como resolver tal situação, De forma ao Silverlight conseguir ententer o FaultException ?
Desde Já, Agradeço.
Discussão (1)
Carregando comentários...