WCF Service on Emulator

Dear All,

I tried today with HelloWorldServer_MF and HelloWorldClient_MF on default emulator using .Net Micro Framework 4.3. All of them gave me a SocketException with a HResult code of 4278190080. I am just wondering is that possible to run DPWS WCF services on a emulator? If not, how can I test it? I am working on a project may want to deploy SOA to crossbow imote 2 boards with .Net Micro Framework. Thanks a lot.

Welcome to the forum!

Have you seen this project on codeshare?

https://www.ghielectronics.com/community/forum/topic?id=12223

There is also some good posts about DPWS by NickP on the forum:

https://www.ghielectronics.com/community/forum/search?q=user%3ANickP+DPWS

Thanks, I am glad that I could join this forum.

Yes I have seen that. However my board is not ready still on order. So I have to deal with emulator at this stage.

I have no idea why whenever calling these DPWS functions and emulator catch exception on socket Exception. Seems to be I cannot use open socket on emulator? I just use the example in the sample folder with .NET MF 4.3

Is it the same if you change framework target to 4.2?

Yes, exactly the same with this message

"A first chance exception of type ‘System.Net.Sockets.SocketException’ occurred in Microsoft.SPOT.Net.dll

If there is a handler for this exception, the program may be safely continued."

@ andre.m - That is what I thought. Is there anything else could affect? I am using Visual Studio 2012 with .Net MF 4.3.

I tried sample with Visual Studio 2010 and .Net MF 4.2 and they works. Just somehow it does not work for .Net MF 4.3 and Visual Studio 2012.

You still can use 4.2 on Visual Studio 2012. There are actually no devices from GHI that run 4.3.

Hi,
My guess as to why you get the exception is because the emulator tried to bind to the first network interface it finds on your pc, which could be the wrong one with no IP…

I would suggest you download the source code and include the dspw section into your code and modify as you fit…

I tried, but that doesn’t any change. I still got this stack
Microsoft.SPOT.Net.SocketNative::setsockopt
System.Net.Sockets.Socket::SetSocketOption
Dpws.Device.Discovery.DpwsDiscoGreeting::SendGreetingMessage
Dpws.Device.Device::Start
Dpws.Device.Program::Start
Dpws.Device.Program::Main

I have no idea why VS2010 works but VS2012 does not.