Ask a questionAsk a question
 

AnswerCall lists webservice from console application

  • Tuesday, June 16, 2009 4:00 PMsyscents Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi people!

    I'm programming a console app that gets information of Lists' Sharepoint web service, using Visual Studio. I programmed this communication in a ASP.net webapp that accessed to this webservice. No problem.

    But now, I try to call Lists webservice from a console app. When I try to add the web refference I only can choose "add service reference". When I add it, I cannot use a lot of classes such Lists class. I'm getting problems working with listssoapclient class so I want to use Lists.

    Does anybody know how to add a web reference from a console application???

    Thank you in advanced

Answers

All Replies

  • Tuesday, June 16, 2009 4:21 PMMoonis TahirMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    please download the console app from this article and you can compare how it is using the reference to lists.asmx.
    http://www.codeproject.com/KB/sharepoint/SharePointListsWebService.aspx

    Moonis Tahir MCSD.net, MCTS Sharepoint 07 (Dev & Config), MCTS BizTalk 06, MCTS SQL 2005.
  • Tuesday, June 16, 2009 5:03 PMSteve.CurranMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You can add a web reference by clicking on "Add Service Reference" and then clicking on the "Advanced" button. From this dialog click on the "Add Web Reference" button.
    certdev.com
  • Tuesday, June 16, 2009 5:28 PMdaniel.larsonMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    3.5 apps use WCF web service technology. If you configure your console app as a 2.0 framework app, you can add a reference using ASMX web service technology (without WCF). (You can always add the web reference as a 2.0 app, and then switch to 3.5 framework if you want. ) So-- "add service reference" is DIFFERENT TECHNOLOGY than "add web service reference" in a 2.0 app. You MAY have better luck using ASMX web service proxies. NOT a recommendation, JUST something you should try out to see if you have better luck. 
    Daniel Larson, SharePoint MVP, MS Press Author, NewsGator Software Developer Check out my books on Amazon: - Inside Microsoft Windows SharePoint Services 3.0 (with Ted Pattson) - Developing Service Oriented AJAX Applications on the Microsoft Platform (.NET 3.5, WCF, Microsoft AJAX)
  • Tuesday, June 16, 2009 5:30 PMdaniel.larsonMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    SWEET!!! Steve, I didn't know about that!!! That makes compatibility a lot easier. LOL, it's amazing the things that I DON'T know sometimes! :)
    Daniel Larson, SharePoint MVP, MS Press Author, NewsGator Software Developer Check out my books on Amazon: - Inside Microsoft Windows SharePoint Services 3.0 (with Ted Pattson) - Developing Service Oriented AJAX Applications on the Microsoft Platform (.NET 3.5, WCF, Microsoft AJAX)
  • Wednesday, June 17, 2009 11:03 AMsyscents Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Absolutely true! Thank you so much people!