Home > Just Blog'ing > DPWS on desktop .NET Version

DPWS on desktop .NET Version

December 12th, 2008 Elze Leave a comment Go to comments

When I published my message about implementing DPWS on .NET Micro Framework I had some questions how to make a Client on the Full .NET Framework.

I tried it and had some succes by disassembling the Micro Framwork DPWS implementation with the Refractor tool, modifying some dependencies and fixing some function differences. This is a solution but obvious not the right solution. I’ve send an e-mail to Steve Maillot if I could make my example public. When doing so I would provide a reverse-engineered and modified version of Microsoft libraries and that’s quite logical not allowed.. Not the solution thus..

Next solution is to make our own basic DPWS client, not the most impossible task in the world but Steve ensured me Microsoft is working on a document explaining how to use WCF to connect to a DPWS device, Not with device discovery, that is planned for the 4.0 .NET release.

So stay tuned.. beter to wait a while than make you’re own half baked solution.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • NuJIJ
  • Technorati
  • Yahoo! Bookmarks
Categories: Just Blog'ing Tags: , ,
  1. ralf
    December 12th, 2008 at 09:38 | #1

    did you disassembled the libraries for running under windows xp since a DPWS client library (known as WSDAPI) is a part of Windows Vista ?

    what exactly you made :

    1) client is a winxp pc – service on an embedded device
    2) client is an embedded device – service on winxp pc

    or you played under win vista with a client ?

    thanks ralf

  2. December 12th, 2008 at 11:22 | #2

    What i’ve done, I ran the DPWS device (service host) on the Micro Framework device and a DPWS client on the Vista desktop. I know about the WSDAPI library, It only lacks the discovery part of DPWS. The bennefit of using the dpws assemblies of .NET MF is that you don’t need to change your MFSvcUtil generated code and you have discovery. But the problem is.. disassembling and the releasing you’re own modified assamblies is not allowed, logical, most software vendors don’t allow this for obvious reasons..

    So we’ve just got to wait for 4.0 WCF for discovery. You should make you’re own (posible incompatible later) version of Ws-Discovery..

    Regards,
    Elze

  3. ralf
    December 12th, 2008 at 11:41 | #3

    a ok so you used the mf assemblies (disassebmled, rewritten partly) and referenced they on a .net console project under vista

  4. sanny
    December 13th, 2008 at 19:49 | #4

    hi elze

    did you used .NET Reflector from red gate (earlier from lutz roeder) ?

    its possible with reflector to save the whole disassembled classes for the dpws assemblies of .NET MF in files or i have to use copy&paste ?

    regards sanny

  5. December 13th, 2008 at 21:54 | #5

    Yes it’s possible.. There is a collection of free addons of .NET reflector.. You can find it here:

    http://www.codeplex.com/reflectoraddins

    Be aware that publishing reverse enginered and modified is not allowed!

  6. sanny
    December 13th, 2008 at 21:59 | #6

    ok thx – yes i know about publishing reverse enginered assemblies, its only for testing purposes

  7. sanny
    December 13th, 2008 at 23:45 | #7

    1) now i successfully created the source from MFDpwsClient
    2) opend the project in vstudio and compiled (lot of errors)
    3) added references to MFDpwsExtensions, MFWsStack, System, System.Xml (all from MF assemblies) and now i can compile the source
    4) added a win console project (and also added MFDpwsExtensions, MFWsStack, System, System.Xml from MF and MFDpwsClient), and tried the client sample ->

    but on DpwsClient.Init:

    this.m_udpSeviceHost = new WsUdpServiceHost(m_discoServiceEndpoints);

    i get the exception:

    “ECall methods must be packaged into a system module.”

    am i doing something wrong ?

  8. sanny
    December 15th, 2008 at 13:05 | #8

    now a i am able from a win xp client discovering elzes service on a .net mf device (MF_DWPS_Host) ;)

    >Found device:
    ModelName: Elze Dpws Test Device
    ModelNumber: 1.0
    FirmwareVersion: alpha
    FriendlyName: Service1Soap
    SerialNumber: 12345678
    Service endpoint found:http://172.22.82.251:8084/34140142-47e3-441e-a534-0b659a9
    7e3c3

  9. sanny
    December 15th, 2008 at 17:05 | #9

    also the multipy service now works fine (win xp client is consumig a .net mf device service)

  10. December 15th, 2008 at 18:06 | #10

    @sanny: Great work! I know it’s posible but I’m a little afraid of telling excactly how, I don’t want to help people commit a crime by publishing their reverse engineered projects. I hope I inspired you.. Now you have to source you can filter out the realy needed parts and write you’re own sourcecode for it..

  11. sanny
    December 15th, 2008 at 18:09 | #11

    yea this was only a testing project – the win xp client works great and consumes the mutiply service of your project

  12. djsg
    December 26th, 2009 at 03:15 | #12

    .net framework 4.0 has been released. but I still cannot find a part that relates to WCF talking to DPWS devices. Any comments?

  13. Tiago
    March 4th, 2010 at 17:05 | #13

    You could help with de tool, you know some tool to do the same thing you did???

  1. No trackbacks yet.