locked
DPWS client and WCF 4.0 host RRS feed

  • Question

  • Hi,

    I like to connect my DPWS device to a WCF 4.0 webservice. This I like to do over the internet (it this possible?) but tried it first on a local network.

    When I probe and resolve on the device I can't get any reaction of the WCF. I try this off course with the WS-Discovery implementation in DPWS that is supported in WCF 4.0.

    This could be wrong code at the client or host and I just can't figure it out.

    Does anyone has code examples or ideas how to debug this in a good way so I can ask my question with more details?

    Thanks!

    Roel
    • Moved by Mog Liang Wednesday, February 24, 2010 7:31 AM From: Windows Communication Foundation (From:Windows Communication Foundation)
    Monday, February 22, 2010 9:08 AM

Answers

  • Hi Roel

    Interoperability with DPWS devices using WCF is not a straightforward task as you need to do a lot of custom tweaking.

    To start, if you're using UdpDiscoveryEndpoint on the service you'll need to pass DiscoveryVersion.WSDiscoveryApril2005 to its constructor.

    Can you share more details about your scenario and your implementation?

    Thanks
    Diego

    Saturday, February 27, 2010 1:32 AM

All replies

  • I am not sure if we can provide more help here if you do not give us more details about your application. What exception are you seeing? How have you defined your service? Have you enabled tracing?

    However, this link may be useful for you: http://www.microsoft.com/downloads/details.aspx?FamilyID=35ec8682-d5fd-4bc3-a51a-d8ad115a8792&displaylang=en. You can download several project samples that will show you how WCF Discovery works.

    Hope this helps.
    Wednesday, February 24, 2010 7:02 PM
    Moderator
  • Hi Amadeo,

    Thanks for getting back to me. I will have a look at the examples tonight and use one them as a base for discovering by the device. So the answer how I have defined the service is then answered. I do not see exceptions, the device just don't discover the wcf. And I did not yet enable tracing wich I keep in mind.

    I will post my experience later!

    Regards,

    Roel

    Thursday, February 25, 2010 7:30 AM
  • Now I'm getting back to you.

    I use the following explorer to discover the WCF service, its a nice tool that handles all you need:

    http://ws4d.e-technik.uni-rostock.de/?p=37

    I use also the project sample from the link: http://www.microsoft.com/downloads/details.aspx?FamilyID=35ec8682-d5fd-4bc3-a51a-d8ad115a8792&displaylang=en that Amadeo provided. The specific project I use is under: ..\WF_WCF_Samples\WCF\Basic\Discovery\Basic with some adjustments like this:

                Uri baseAddress = new Uri("http://localhost:8000/60b76423-aa2e-4de4-b1e0-83bc107376f3/");
    

    And

                    ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
                    smb.HttpGetEnabled = true;
                    smb.HttpGetUrl = baseAddress;
                    serviceHost.Description.Behaviors.Add(smb);

    You can find the wsdl now here:

    http://localhost:8000/60b76423-aa2e-4de4-b1e0-83bc107376f3/?wsdl

    and import it manually but that is not working. Also searching on urn or probe for all services results not in this service. Other services on the network it can find!

    Please advise!

    Roel
     

    Thursday, February 25, 2010 9:20 AM
  • Is that sample with no modifications working for you? Make sure the service is discoverable: add a service discovery behavior to it and a discovery endpoint behavior. Also, I do not know how that tool that you are using works, but if you are using a WCF client make sure to add a dynamic endpoint with the binding and the contract of the service that you want to discover. I do not think yu should need more than that for your scenario.

    Hope this helps.
    Thursday, February 25, 2010 5:19 PM
    Moderator
  • I set up my WCF service totally basic except that I added the MEX configuration like I said in my previous post. The WCF service is working. The problem is still, like I said in my first post, it is not discoverable by a DPWS client.

    The tool could be only working for DPWS services and it could be the reason why it not detects the WCF service. Does anyone knows how I can monitor (sniff) the WCF services Hello and Bye messages? I tried Fiddler but that is not displaying any Http traffic. Also the messages are, as far as I know, sent over UDP. Maybe Fiddler can only see TCP?

    Regards,

    Roel
    Friday, February 26, 2010 9:24 AM
  • I am glad to hear your WCF scenario is working. ABout the tool you are using, not sure, that might be the case.
    Friday, February 26, 2010 6:02 PM
    Moderator
  • Hi Roel

    Interoperability with DPWS devices using WCF is not a straightforward task as you need to do a lot of custom tweaking.

    To start, if you're using UdpDiscoveryEndpoint on the service you'll need to pass DiscoveryVersion.WSDiscoveryApril2005 to its constructor.

    Can you share more details about your scenario and your implementation?

    Thanks
    Diego

    Saturday, February 27, 2010 1:32 AM
  • Hi Diego,

    I now see you your post. Sorry for the delay.

    I've got a sensor with a Zigbee receiver. It sends his data to a motherdevice that is connected to the internet. I like to store the data of the sensor on a WCF on the internet.

    I doubt if it is possible, but somehow it should be done. So any ideas are welcome!

    Roel

    Friday, March 26, 2010 3:02 PM
  • The problem was that it was on another subnet. This is not possible with DPWS.
    Tuesday, March 30, 2010 12:57 PM