none
Generic WCF client RRS feed

  • Question

  • My requirement is to build a generic WCF client able to call any kind of web services based on definitions provided programmatically to the generic client.

    Is it doable with WCF? Is it possible to read the SOAP body returned by the web service?

    Thanks in advance

    Tuesday, January 18, 2011 1:13 AM

Answers

  • Frank,

    The sample Carlos pointed out allows a client to consume WSDL, generate classes that will allow you to interact with the service, and then use those classes to call the service. The whole idea behind this sample (and really WCF in general) is so that you don't need to work directly with the SOAP messages. WCF abstracts it away. You can work directly with the Message class as discussed here: http://msdn.microsoft.com/en-us/library/ms734675.aspx.

    Thanks,

    Michael Green
    WCF Documentation Team

    • Marked as answer by Yi-Lun Luo Monday, January 24, 2011 9:57 AM
    Tuesday, January 18, 2011 11:25 PM

All replies

  • It is certainly possible. But you need to write lot of custom code for this. You need to parse WSDL/SOAP generated by the SVC file and invoke the methods based on the parameter. 

    What you are essentially trying to do write a similar application to WCFTESTCLIENT which ships with .NET 4 and VS2010

    http://msdn.microsoft.com/en-us/library/bb552364.aspx

     


    Tanvir Huda
    Tuesday, January 18, 2011 1:55 AM
  • Thanks for your answer. The WCF Test Client is close to what I'm trying to achieve.

    Doing it is easy with ASP methods httpwebrequest and httpwebresponse. Does WCF include an equivalent of the these methods?

    Tuesday, January 18, 2011 2:46 AM
  • There's something close to the WCF Test Client, the "WCF Dynamic Proxy". You can find some information about it at http://blogs.msdn.com/b/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx. Basically, you point it to a service description (WSDL), and it creates a client which can be used to call the operations on the service.
    Tuesday, January 18, 2011 5:44 AM
  • Thanks for your answer. Is it possible to read the returned XML message with this class?
    Tuesday, January 18, 2011 10:25 PM
  • Frank,

    The sample Carlos pointed out allows a client to consume WSDL, generate classes that will allow you to interact with the service, and then use those classes to call the service. The whole idea behind this sample (and really WCF in general) is so that you don't need to work directly with the SOAP messages. WCF abstracts it away. You can work directly with the Message class as discussed here: http://msdn.microsoft.com/en-us/library/ms734675.aspx.

    Thanks,

    Michael Green
    WCF Documentation Team

    • Marked as answer by Yi-Lun Luo Monday, January 24, 2011 9:57 AM
    Tuesday, January 18, 2011 11:25 PM
  • Hi Frank,

       Even I am working to develop  the same tool, If you have any information please share with me.


    MANIKANTA

    Tuesday, May 28, 2013 10:51 AM