Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I got around this by generating a wrapper class for the ClientBase-derived class during the import process. I actually first tried generating an additional partial class with the same name as the client class, but that caused the rest of the code generation to stop working properly.</p> <p>So my final generated code looks something like:</p> <p>(generated by the built-in WCF proxy generator):</p> <pre><code>public interface ServiceReference1 { IAsyncResult BeginWebMethod1(AsyncCallback callback, object asyncState); void EndWebMethod1(IAsyncResult result); IAsyncResult BeginWebMethod2(AsyncCallback callback, object asyncState); void EndWebMethod2(IAsyncResult result); // ... } public class ServiceReference1Client { public event EventHandler&lt;AsyncCompletedEventArgs&gt; WebMethod1Completed; public event EventHandler&lt;AsyncCompletedEventArgs&gt; WebMethod2Completed; public void WebMethod1Async() { /* ... */ } public void WebMethod2Async() { /* ... */ } // ... } </code></pre> <p>(generated by my custom <code>IOperationContractGenerationExtension</code>):</p> <pre><code>public class ServiceReference1Wrapper { private ServiceReference1Client _client; public ServiceReference1Wrapper(ServiceReference1Client client) { _client = client; } public IObservable&lt;AsyncCompletedEventArgs&gt; WebMethod1() { _client.WebMethod1Async(); // ... } public IObservable&lt;AsyncCompletedEventArgs&gt; WebMethod2() { _client.WebMethod2Async(); // ... } // ... } </code></pre> <p>Note: I'm using Silverlight, so that's why everything is async.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload