Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use a contract-first approach, generally (but not always) using the same type representation at each end.</p> <p>Actually, to use WCF you don't need any special proxies etc; you can use your regular .NET types at both ends and not use <code>svcutil.exe</code> <em>at all</em>. Getting a working service is as simple as adding the "ABC" into the configuration file, and using something like:</p> <pre><code>public sealed class WcfClient&lt;T&gt; : System.ServiceModel.ClientBase&lt;T&gt; where T : class { public T Service { get { return base.Channel; } } } </code></pre> <p>Now you can use:</p> <pre><code>using(var client = new WcfClient&lt;IMyService&gt;()) { int i = client.Service.SomeMethod("abc"); } </code></pre> <p>and all you have at the client (and server) is your <code>IMyService</code> interface.</p> <hr> <p>For other tools; protobuf-net is an implementation of Google's "protocol buffers" API, which has a DSL for describing data and services in a "contract first" (and portable/interoperable) way - for example (a .proto file):</p> <pre><code>message SearchRequest { required string query = 1; optional int32 page_number = 2; optional int32 result_per_page = 3; } message SearchResponse { repeated string result = 1; } service SearchService { rpc Search (SearchRequest) returns (SearchResponse); } </code></pre> <p>The protobuf-net tool (which I maintain) includes a "protogen" utility to transform this DSL into C#/VB; and one of the options (for C#, at least - I'd need to check VB) is to emit a full WCF proxy implementation (with your choice of sync or async methods); very similar to svcutil - but (due to the protobuf-net relationship) it includes the custom <code>[ProtoBehavior]</code> attribute on the operation-contracts so that it uses the protobuf-net serializer instead of <code>DataContractSerializer</code> (faster and more efficient, but different).</p> <p>For VS integration; I'm working on exactly that (<a href="http://code.google.com/p/protobuf-net/source/browse/trunk/ProtoBufGenerator" rel="noreferrer">proof</a>).</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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