Question

J'ai un service WCF qui ajoute des en-têtes à la réponse. Je voudrais savoir comment extraire ces en-têtes du côté du client.

Était-ce utile?

La solution

J'ai trouvé la réponse:

http://msdn.microsoft.com/en-us/library/ms195389.aspx

MessageHeaders.GetHeader(Of T) Method (Int32)

Par exemple, dans un IclientMessageInspector à l'aide de l'objet de réponse, vous l'obtenez comme ainsi:

MyObject myObj = reply.Headers.GetHeader<MyObject>(index);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top