PC Review


Reply
Thread Tools Rate Thread

Connecting to a WCF Host from .NET CF

 
 
Victor Espina
Guest
Posts: n/a
 
      21st Mar 2011
Hi, this is my scenario:

a) I have a Windows Service running a WCF host that is created this
way:

ServiceHost wcfHost = new
ServiceHost(typeof(serverProxy), new Uri[]{new Uri("http://localhost:
1967")});
wcfHost.AddServiceEndpoint(typeof(ILicensingServer),
new BasicHttpBinding(),
"bbls");

b) I have a desktop app that connect to this WCF host using this code:

// Define an http channel to the licensing server
ChannelFactory<ILicensingServer> httpFactory =
new ChannelFactory<ILicensingServer>(
new BasicHttpBinding(),
new EndpointAddress(serverUrl));

// Create the http channel
server = httpFactory.CreateChannel();

c) I have a Windows Mobile app that needs to connect to this WCF host,
but I just realized that System.ServiceModel in .NET CF 3.5 does not
implements ChannelFactory class.

Is there any way for my WM app to connect to my WCF host ?

Regards

Victor Espina
 
Reply With Quote
 
 
 
 
Brian
Guest
Posts: n/a
 
      22nd Mar 2011
On Mar 21, 10:07*am, Victor Espina <vespi...@gmail.com> wrote:
> Hi, this is my scenario:
>
> a) I have a Windows Service running a WCF host that is created this
> way:
>
> * * * * * * * * ServiceHost wcfHost = new
> ServiceHost(typeof(serverProxy), new Uri[]{new Uri("http://localhost:
> 1967")});
> * * * * * * * * wcfHost.AddServiceEndpoint(typeof(ILicensingServer),
> * * * * * * * * * new BasicHttpBinding(),
> * * * * * * * * * "bbls");
>
> b) I have a desktop app that connect to this WCF host using this code:
>
> * * * * * * * * // Define an http channel to the licensing server
> * * * * * * * * ChannelFactory<ILicensingServer> httpFactory =
> * * * * * * * * new ChannelFactory<ILicensingServer>(
> * * * * * * * * * new BasicHttpBinding(),
> * * * * * * * * * new EndpointAddress(serverUrl));
>
> * * * * * * * * // Create the http channel
> * * * * * * * * server = httpFactory.CreateChannel();
>
> c) I have a Windows Mobile app that needs to connect to this WCF host,
> but I just realized that System.ServiceModel in .NET CF 3.5 does not
> implements ChannelFactory class.
>
> Is there any way for my WM app to connect to my WCF host ?
>
> Regards
>
> Victor Espina


When I run into issues like this, where the CF does not have a class
implemented that is available in the full framework, the vast majority
of the time it can be found in the OpenNETCF Smart Device Framework.
Have a look in there, see if they've implemented it for you.
 
Reply With Quote
 
Victor Espina
Guest
Posts: n/a
 
      22nd Mar 2011
Brian, thanks a lot for your suggestion. Indeed the good folks at
OpenNETCF has done some pretty job about using WCF on .NET CF, and I
just found a paper who describes how to make my service discoverable,
and I think that is just what I was missing.

Regards

Victor Espina

On 22 mar, 12:51, Brian <bloodbr...@gmail.com> wrote:
> On Mar 21, 10:07*am, Victor Espina <vespi...@gmail.com> wrote:
>
> > Hi, this is my scenario:

>
> > a) I have a Windows Service running a WCF host that is created this
> > way:

>
> > * * * * * * * * ServiceHost wcfHost = new
> > ServiceHost(typeof(serverProxy), new Uri[]{new Uri("http://localhost:
> > 1967")});
> > * * * * * * * * wcfHost.AddServiceEndpoint(typeof(ILicensingServer),
> > * * * * * * * * * new BasicHttpBinding(),
> > * * * * * * * * * "bbls");

>
> > b) I have a desktop app that connect to this WCF host using this code:

>
> > * * * * * * * * // Define an http channel to the licensing server
> > * * * * * * * * ChannelFactory<ILicensingServer> httpFactory =
> > * * * * * * * * new ChannelFactory<ILicensingServer>(
> > * * * * * * * * * new BasicHttpBinding(),
> > * * * * * * * * * new EndpointAddress(serverUrl));

>
> > * * * * * * * * // Create the http channel
> > * * * * * * * * server = httpFactory.CreateChannel();

>
> > c) I have a Windows Mobile app that needs to connect to this WCF host,
> > but I just realized that System.ServiceModel in .NET CF 3.5 does not
> > implements ChannelFactory class.

>
> > Is there any way for my WM app to connect to my WCF host ?

>
> > Regards

>
> > Victor Espina

>
> When I run into issues like this, where the CF does not have a class
> implemented that is available in the full framework, the vast majority
> of the time it can be found in the OpenNETCF Smart Device Framework.
> Have a look in there, see if they've implemented it for you.


 
Reply With Quote
 
Victor Espina
Guest
Posts: n/a
 
      22nd Mar 2011
Errata:

"...found a paper WHO describes..."

should said:

"...found a paper WICH describes..."


Regards

Victor Espina


On 22 mar, 17:08, Victor Espina <vespi...@gmail.com> wrote:
> Brian, thanks a lot for your suggestion. Indeed the good folks at
> OpenNETCF has done some pretty job about using WCF on .NET CF, and I
> just found a paper who describes how to make my service discoverable,
> and I think that is just what I was missing.
>
> Regards
>
> Victor Espina
>
> On 22 mar, 12:51, Brian <bloodbr...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On Mar 21, 10:07*am, Victor Espina <vespi...@gmail.com> wrote:

>
> > > Hi, this is my scenario:

>
> > > a) I have a Windows Service running a WCF host that is created this
> > > way:

>
> > > * * * * * * * * ServiceHost wcfHost = new
> > > ServiceHost(typeof(serverProxy), new Uri[]{new Uri("http://localhost:
> > > 1967")});
> > > * * * * * * * * wcfHost.AddServiceEndpoint(typeof(ILicensingServer),
> > > * * * * * * * * * new BasicHttpBinding(),
> > > * * * * * * * * * "bbls");

>
> > > b) I have a desktop app that connect to this WCF host using this code:

>
> > > * * * * * * * * // Define an http channel to the licensing server
> > > * * * * * * * * ChannelFactory<ILicensingServer> httpFactory =
> > > * * * * * * * * new ChannelFactory<ILicensingServer>(
> > > * * * * * * * * * new BasicHttpBinding(),
> > > * * * * * * * * * new EndpointAddress(serverUrl));

>
> > > * * * * * * * * // Create the http channel
> > > * * * * * * * * server = httpFactory.CreateChannel();

>
> > > c) I have a Windows Mobile app that needs to connect to this WCF host,
> > > but I just realized that System.ServiceModel in .NET CF 3.5 does not
> > > implements ChannelFactory class.

>
> > > Is there any way for my WM app to connect to my WCF host ?

>
> > > Regards

>
> > > Victor Espina

>
> > When I run into issues like this, where the CF does not have a class
> > implemented that is available in the full framework, the vast majority
> > of the time it can be found in the OpenNETCF Smart Device Framework.
> > Have a look in there, see if they've implemented it for you.


 
Reply With Quote
 
Brian
Guest
Posts: n/a
 
      24th Mar 2011
On Mar 22, 2:45*pm, Victor Espina <vespi...@gmail.com> wrote:
> Errata:
>
> "...found a paper WHO describes..."
>
> should said:
>
> "...found a paper WICH describes..."
>
> Regards
>
> Victor Espina
>
> On 22 mar, 17:08, Victor Espina <vespi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Brian, thanks a lot for your suggestion. Indeed the good folks at
> > OpenNETCF has done some pretty job about using WCF on .NET CF, and I
> > just found a paper who describes how to make my service discoverable,
> > and I think that is just what I was missing.

>
> > Regards

>
> > Victor Espina

>
> > On 22 mar, 12:51, Brian <bloodbr...@gmail.com> wrote:

>
> > > On Mar 21, 10:07*am, Victor Espina <vespi...@gmail.com> wrote:

>
> > > > Hi, this is my scenario:

>
> > > > a) I have a Windows Service running a WCF host that is created this
> > > > way:

>
> > > > * * * * * * * * ServiceHost wcfHost = new
> > > > ServiceHost(typeof(serverProxy), new Uri[]{new Uri("http://localhost:
> > > > 1967")});
> > > > * * * * * * * * wcfHost.AddServiceEndpoint(typeof(ILicensingServer),
> > > > * * * * * * * * * new BasicHttpBinding(),
> > > > * * * * * * * * * "bbls");

>
> > > > b) I have a desktop app that connect to this WCF host using this code:

>
> > > > * * * * * * * * // Define an http channel to the licensing server
> > > > * * * * * * * * ChannelFactory<ILicensingServer> httpFactory =
> > > > * * * * * * * * new ChannelFactory<ILicensingServer>(
> > > > * * * * * * * * * new BasicHttpBinding(),
> > > > * * * * * * * * * new EndpointAddress(serverUrl));

>
> > > > * * * * * * * * // Create the http channel
> > > > * * * * * * * * server = httpFactory.CreateChannel();

>
> > > > c) I have a Windows Mobile app that needs to connect to this WCF host,
> > > > but I just realized that System.ServiceModel in .NET CF 3.5 does not
> > > > implements ChannelFactory class.

>
> > > > Is there any way for my WM app to connect to my WCF host ?

>
> > > > Regards

>
> > > > Victor Espina

>
> > > When I run into issues like this, where the CF does not have a class
> > > implemented that is available in the full framework, the vast majority
> > > of the time it can be found in the OpenNETCF Smart Device Framework.
> > > Have a look in there, see if they've implemented it for you.


Glad it worked out. Good luck!
 
Reply With Quote
 
Victor Espina
Guest
Posts: n/a
 
      25th Mar 2011
After getting my WM connected to my WCF server, it turned out that for
some reason I couldn't get an Object[] member to be correctly
serialized when filled with a custom type. I'm pretty sure I was
missing some serialization attributes, but couldn't figure it out. So,
I ended writing my own basic serialization/deserialization class and
everything is working like a charm now

Thanks again for you help

Victor Espina


On 24 mar, 12:23, Brian <bloodbr...@gmail.com> wrote:
> On Mar 22, 2:45*pm, Victor Espina <vespi...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Errata:

>
> > "...found a paper WHO describes..."

>
> > should said:

>
> > "...found a paper WICH describes..."

>
> > Regards

>
> > Victor Espina

>
> > On 22 mar, 17:08, Victor Espina <vespi...@gmail.com> wrote:

>
> > > Brian, thanks a lot for your suggestion. Indeed the good folks at
> > > OpenNETCF has done some pretty job about using WCF on .NET CF, and I
> > > just found a paper who describes how to make my service discoverable,
> > > and I think that is just what I was missing.

>
> > > Regards

>
> > > Victor Espina

>
> > > On 22 mar, 12:51, Brian <bloodbr...@gmail.com> wrote:

>
> > > > On Mar 21, 10:07*am, Victor Espina <vespi...@gmail.com> wrote:

>
> > > > > Hi, this is my scenario:

>
> > > > > a) I have a Windows Service running a WCF host that is created this
> > > > > way:

>
> > > > > * * * * * * * * ServiceHost wcfHost = new
> > > > > ServiceHost(typeof(serverProxy), new Uri[]{new Uri("http://localhost:
> > > > > 1967")});
> > > > > * * * * * * * * wcfHost.AddServiceEndpoint(typeof(ILicensingServer),
> > > > > * * * * * * * * * new BasicHttpBinding(),
> > > > > * * * * * * * * * "bbls");

>
> > > > > b) I have a desktop app that connect to this WCF host using this code:

>
> > > > > * * * * * * * * // Define an http channel to the licensing server
> > > > > * * * * * * * * ChannelFactory<ILicensingServer> httpFactory =
> > > > > * * * * * * * * new ChannelFactory<ILicensingServer>(
> > > > > * * * * * * * * * new BasicHttpBinding(),
> > > > > * * * * * * * * * new EndpointAddress(serverUrl));

>
> > > > > * * * * * * * * // Create the http channel
> > > > > * * * * * * * * server = httpFactory.CreateChannel();

>
> > > > > c) I have a Windows Mobile app that needs to connect to this WCF host,
> > > > > but I just realized that System.ServiceModel in .NET CF 3.5 does not
> > > > > implements ChannelFactory class.

>
> > > > > Is there any way for my WM app to connect to my WCF host ?

>
> > > > > Regards

>
> > > > > Victor Espina

>
> > > > When I run into issues like this, where the CF does not have a class
> > > > implemented that is available in the full framework, the vast majority
> > > > of the time it can be found in the OpenNETCF Smart Device Framework..
> > > > Have a look in there, see if they've implemented it for you.

>
> Glad it worked out. *Good luck!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to an Unknown Host =?Utf-8?B?UmV1YmVu?= Microsoft Dot NET 0 14th Jun 2007 02:41 AM
Connecting to host computer =?Utf-8?B?Z3JhaGFt?= Windows XP Work Remotely 1 22nd Feb 2006 02:18 AM
Connecting to host server =?Utf-8?B?SmFuQg==?= Microsoft Frontpage 9 22nd Oct 2005 04:34 AM
Server connecting to outside host Leo Microsoft Windows 2000 Security 1 26th Nov 2003 04:06 AM
Connecting WinXP to DOS 6.22 host Mike Stevens Windows XP Networking 4 31st Oct 2003 10:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:58 PM.