Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not 100% sure what you really want to achieve, but let me explain a few basics about WCF.</p> <p>A lot of programmers mistakenly take WCF to be some sort of a .NET remoting - e.g. they believe you're basically reaching out to a remote object on a server far away, calling a method on a "remoted" .NET object somewhere. This is absolutely not the case!</p> <p>WCF is about <strong>messaging</strong> - your client and server exchange nothing but <strong>serialized messages</strong> (and possibly headers) - but that's it. </p> <p>That said: those message exchange mechanisms are designed to be interoperable with a lot of non .NET platforms - Java, Ruby - you name it. They leverage the WSDL and XSD mechanisms to exchange descriptions of operations (WSDL) and the data structures being exchanged (XSD).</p> <p>WSDL and XSD are all about well defined, explicit calls and data structures. The functionality offered by those standards is the lowest common denominator between all SOA platforms - and as such, it's quite a bit more limited than what you might have grown accustomed to using pure .NET. The SOA world and the OOP world don't always match very well.</p> <p>So in the end, what you really need to understand and program against, are the standards as defined by WSDL/XSD - and as such, you need to forget about all .NET niceties like generics, interfaces and classes implementing those interfaces really quickly. They simply don't work over the WCF messaging infrastructure.</p> <p>All you can exchange between a WCF client and a WCF server is whatever you can describe and express in XML schema - concrete types made up of basic data types like strings, integers, and so forth. XSD supports a bit of inheritance, but it doesn't know squat about generics, and it doesn't deal with interfaces and non-concrete classes at all.</p> <p>So out of the box, I don't think your approach with a generic interface and messages implementing that interface and WCF figuring out what real method to call based on that class will fly. It's just not the way WCF was architected and designed to work. </p> <p>You might be able to create a custom (but concrete) base class, and you might be able to extend the WCF operation dispatcher on the server side to call different methods based on your classes being passed in (or some extra info in the headers coming along for the ride) - but I neither think that'll be easy, nor really the way WCF is intended to work - no guarantees that you'll really be able to pull it off.</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.
 

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