J'utilise SL 4 et un service WCF .net-4 avec un PollingDuplexHttpBinding. Appeler le service et rappeler le client du service fonctionne bien. Mais dès que j'appelle le service, disons 15 fois sans attendre la réponse asynchrone, je reçois une exception TargetInvocationException après avoir obtenu 0, 1 ou 2 réponses réussies.TargetInvocationException sur plusieurs appels de service WCF
Mes attributs pour le service sont:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Multiple)]
Ceci est dans mon web.config:
<behaviors>
<serviceBehaviors>
<behavior name="RecordProviderServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceTimeouts transactionTimeout="05:05:00" />
<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500"
maxConcurrentInstances="2147483647" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<bindings>
<pollingDuplexHttpBinding>
<binding name="multipleMessagesPerPollPollingDuplexHttpBinding"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
maxOutputDelay="00:00:00.200" duplexMode="MultipleMessagesPerPoll" />
</pollingDuplexHttpBinding>
</bindings>
Et comme ça, j'instancier le service côté client:
var binding = new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll)
{
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647
};
_service = new ServiceClient(new InstanceContext(this),
binding,
new EndpointAddress("path to .svc"));
Comme je suis nouveau à WCF: ai-je raté quelque chose? TargetInvocationException doit avoir une propriété InnerException contenant l'exception réelle, il peut vous donner quelques indices.
Il est juste le service « Not Found » Exception –