Connecting to a WCF Host from .NET CF

V

Victor Espina

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
 
B

Brian

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.
 
V

Victor Espina

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

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 ?

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.
 
V

Victor Espina

Errata:

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

should said:

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


Regards

Victor Espina


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

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.
 
B

Brian

Errata:

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

should said:

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

Regards

Victor Espina

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.

Victor Espina
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!
 
V

Victor Espina

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


"...found a paper WHO describes..."
should said:
"...found a paper WICH describes..."

Victor Espina
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
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!
 
Joined
Feb 5, 2014
Messages
1
Reaction score
0
Hi Victor,

I am experiencing the same issues. Would you please let me know how you connected to the Mobile or how you solved the issues?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top