locked
WCF Dynamic proxy for net.tcp RRS feed

  • Question

  • Hello everyBody.

    I have problem.
    when i use WCF Dynamic proxy for netTcpBinding,
    it gives "The URI prefix is not recognized" error when
    run disco.DiscoverAny(wsdlUri) statement
    where disco is DiscoveryClientProtocol.
    It runs with wsHttpBinding fine.

    Please guide me.

    Many thanks

    Wednesday, September 30, 2009 6:34 PM

Answers

  • Hi,
    You can host your service over TCP binding but the sample seem to reach for the metadata of the service using Http Get request. So what you need to do is the following:
    1. On the service side - add the following if not already there -
                ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();
                metadataBehavior.HttpGetEnabled = true;
                metadataBehavior.HttpGetUrl = new Uri("http://<machinename>:<portname>/<address>");
    This forms the absolute address from where the Dynamic Client will fetch the WSDL.
    2. Make sure that the port specified here is different from the port of your service endpoint.
    3. On the client - specify serviceWsdlUri as the HttpGetUrl specified on the service.
    4. And one final thing - netTcpBinding uses Transport security by default so unless you have an application requirement for this and you have configured this properly, you might run into security issues and so specify new NetTcpBinding(SecurityMode.None) in the service.
    Tested it on my machine, should work :-)
    Thanks.
    • Marked as answer by Riquel_Dong Wednesday, October 7, 2009 2:32 AM
    Saturday, October 3, 2009 8:27 PM
  • Hi Piyush ,

    I solved my problem.
    Thank you very much for your reply.

    • Marked as answer by salihb Wednesday, October 7, 2009 4:59 PM
    Wednesday, October 7, 2009 4:59 PM

All replies

  • Hi,
    You can host your service over TCP binding but the sample seem to reach for the metadata of the service using Http Get request. So what you need to do is the following:
    1. On the service side - add the following if not already there -
                ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();
                metadataBehavior.HttpGetEnabled = true;
                metadataBehavior.HttpGetUrl = new Uri("http://<machinename>:<portname>/<address>");
    This forms the absolute address from where the Dynamic Client will fetch the WSDL.
    2. Make sure that the port specified here is different from the port of your service endpoint.
    3. On the client - specify serviceWsdlUri as the HttpGetUrl specified on the service.
    4. And one final thing - netTcpBinding uses Transport security by default so unless you have an application requirement for this and you have configured this properly, you might run into security issues and so specify new NetTcpBinding(SecurityMode.None) in the service.
    Tested it on my machine, should work :-)
    Thanks.
    • Marked as answer by Riquel_Dong Wednesday, October 7, 2009 2:32 AM
    Saturday, October 3, 2009 8:27 PM
  • Hi Piyush ,

    I solved my problem.
    Thank you very much for your reply.

    • Marked as answer by salihb Wednesday, October 7, 2009 4:59 PM
    Wednesday, October 7, 2009 4:59 PM
  • Hello Piyush,

    I am using Dynamic Proxy Library by Vipul Modi. I want all endpoints with netTcpBinding binding. So, I added one serviceBehaviors tag with httpGetEnabled=true and httpGetUrl with http://localhost:3030/service URI in my App.config. I can see service running on WCFTestClient. Also, httpGetUrl on browser.

    I can create factory by DynamicProxyFactory but, when I tries to call CreateProxy by passing contractName. It errors out. I tried to pass all possible name but could not make it work. Any help will be helpful.

    Best,
    Gaurang 

    Friday, April 15, 2011 9:31 PM
  • Hi Gaurang,

     

    I think you have not modified the binding information from "WSHttpBinding" to "NetTcpBinding" when adding it to the service end point. Can you check this.

     

    Thanks,

    Mallikarjun


    Regards, Mallikarjun
    • Proposed as answer by Mallikarjun B Wednesday, May 4, 2011 9:26 AM
    Wednesday, May 4, 2011 9:26 AM