Informatica

Páginas: 3 (564 palabras) Publicado: 23 de noviembre de 2012
ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/ws_fxwebservices/html/13fe3a21-95eb-40a7-af64-615515ea0dbd.htm

How to: Implement an Asynchronous Web Service Client Using the Callback Technique

Thecallback technique is one way to implement a Web service client to communicate with a Web service method asynchronously, even though the method may be intended for synchronous access. The technique isexplained in the topic Communicating with XML Web Services Asynchronously.

This example is based on a Web service class PrimeFactorizer with a method Factorize, for which the Wsdl.exe tool hasgenerated two asynchronous client proxy methods, BeginFactorize and EndFactorize.

To implement the callback technique

1. Define a callback function that implements the AsyncCallback delegate.
|C# |[pic]Copy Code |
|public static void FactorizeCallback(IAsyncResult ar)|
|Visual Basic  |[pic]Copy Code ||Public Shared Sub FactorizeCallback(ar As IAsyncResult) |


2. Instantiate the AsyncCallback delegate.
|C# |[pic]Copy Code |
|AsyncCallback cb = new AsyncCallback(TestCallback.FactorizeCallback);|
|Visual Basic  |[pic]Copy Code |
|Dim cb asAsyncCallback |
|cb = new AsyncCallback(AddressOf TestCallback.FactorizeCallback)...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Informatica
  • Informatica
  • Informatica
  • Informatica
  • Informatica
  • Informática
  • Informatica
  • Informatica

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS