none
Build Proxy Class from WSDL RRS feed

  • Question

  • Dear All

    I am new to web service

    It seems that my colleque used VS tool "wsdl" to generate a proxy class

    and then use it to call web service.

    The following is the development flow I GUESSED.

    1) Find out the WSDL link

    2) Use WSDL tool to generate a proxy class

    3) Put it in the application project

    4) call the method descried in proxy class

    Then it works. 

    I would like to know

    a) is the above 4 steps correct to use a web service online?

    and b) what is the difference between generating proxy class and add a service reference to the wsdl directly

    Thanks



    Best Regards
    mintssoul

    Tuesday, April 21, 2015 8:15 AM

Answers

  • Hello,

    if you add a service reference through visual studio, the steps 2 and 3 are done automatically. After doing this, you can find a "Service References" directory within your project that contains a directory for each added service, e.g. "ServiceReference1". The directory "ServiceReference1" then contains the generated csharp code, the wsdl file that was downloaded from the provided url and some settings. However, all these files are considered automatically when the project is being built, so you just need to add the service reference.

    Regards,
    Henning Dieterichs
    Developer-Hotline for MSDN Online Germany

    Disclaimer:
    Please take into consideration, that further inquiries cannot or will be answered with delay.
    For further information please contact us per telephone through the MSDN-Entwickler-Hotline: http://www.msdn-online.de/Hotline
    MSDN-Entwickler-Hotline: Fast and professional help for software developers free of charge!

    For this post by the MSDN-Entwickler-Hotline the following terms and conditions apply: Trademarks, Privacy as well as the separate terms of use for the MSDN-Entwickler-Hotline .

    • Marked as answer by mintssoul Wednesday, April 22, 2015 3:17 AM
    Tuesday, April 21, 2015 11:53 AM
  • Hi mintssoul,

    When you try to consume the WCF Service, using the WSDL tool to generate a proxy class and using the "Add Services Reference" can give you the same result in many times.
    Besides, both of the two approaches have their advantage and disadvantage, it just depends on what you want to do. For the difference between them, please try to refer to the following article:
    http://blogs.msdn.com/b/lifenglu/archive/2007/08/13/side-by-side-comparsion-between-svcutil-and-the-service-reference-in-vs.aspx .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, April 22, 2015 2:23 AM
    Moderator

All replies

  • Hello,

    if you add a service reference through visual studio, the steps 2 and 3 are done automatically. After doing this, you can find a "Service References" directory within your project that contains a directory for each added service, e.g. "ServiceReference1". The directory "ServiceReference1" then contains the generated csharp code, the wsdl file that was downloaded from the provided url and some settings. However, all these files are considered automatically when the project is being built, so you just need to add the service reference.

    Regards,
    Henning Dieterichs
    Developer-Hotline for MSDN Online Germany

    Disclaimer:
    Please take into consideration, that further inquiries cannot or will be answered with delay.
    For further information please contact us per telephone through the MSDN-Entwickler-Hotline: http://www.msdn-online.de/Hotline
    MSDN-Entwickler-Hotline: Fast and professional help for software developers free of charge!

    For this post by the MSDN-Entwickler-Hotline the following terms and conditions apply: Trademarks, Privacy as well as the separate terms of use for the MSDN-Entwickler-Hotline .

    • Marked as answer by mintssoul Wednesday, April 22, 2015 3:17 AM
    Tuesday, April 21, 2015 11:53 AM
  • Dear Henning

    Thank you. From your point, the two approaches seems getting the same result.

    So is it suggested to use Add Service Reference instead of using wsdl tool? thanks.


    Best Regards
    mintssoul


    • Edited by mintssoul Wednesday, April 22, 2015 3:17 AM
    Wednesday, April 22, 2015 1:22 AM
  • Hi mintssoul,

    When you try to consume the WCF Service, using the WSDL tool to generate a proxy class and using the "Add Services Reference" can give you the same result in many times.
    Besides, both of the two approaches have their advantage and disadvantage, it just depends on what you want to do. For the difference between them, please try to refer to the following article:
    http://blogs.msdn.com/b/lifenglu/archive/2007/08/13/side-by-side-comparsion-between-svcutil-and-the-service-reference-in-vs.aspx .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, April 22, 2015 2:23 AM
    Moderator