I'm new to this WCF world, and have attempted to create a WCF service
which takes a typed dataset as its data contract. I know this isn't
always put forward for interopability, but I'm working in a pure .Net
environment (.Net 3.0) and VS2005.
However, how do I get the client to populate this data object to send
into the WCF service? After I generate the proxy class using svcutil
and do;
TypedDataSet ds = new TypedDataSet();
The 'ds' object isn't what I'd expect from a dataset! So how'd I get
data into it?!??!
Sorry if vague...
Alternatively any good web sites on WCF and data contracts?
Cheers
This also means you can have sensible business logic in your entity at
the client, rather than just the raw proxy.
Marc
public sealed class WcfClient<T> : System.ServiceModel.ClientBase<T>,
IDisposable where T : class
{
void IDisposable.Dispose() { Dispose(); } // re-implement dispose
public void Dispose()
{
try
{// faulted state is poorly implemented by MS, and blocks
Close() and Dispose()!
switch (State)
{
case CommunicationState.Opened:
case CommunicationState.Opening:
Close(); break;
case CommunicationState.Faulted:
Abort(); break;
}
}
catch { }
}
public T Service
{
get { return base.Channel; }
}
}
[ServiceContract]
interface IFoo
{
[OperationContract]
void Bar();
}
static class Program {
static void Main()
{
// use our WCF service
using (WcfClient<IFoo> client = new WcfClient<IFoo>())
{
client.Service.Bar();
}
}
}
Marc,
Many thanks this is exactly what I was looking for, it works a
treat.
Cheers
Mat
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
WCF with Interface Development
If you want to stick with strong datasets, that would work with the above
setup as well.
<matthew...@ntlworld.com> wrote in message
news:cd719bbd-0a85-4495...@34g2000hsf.googlegroups.com...