locked
using .asmx (web service) files locally within my asp.net app as the datasource from my asp.net app RRS feed

  • Question

  • User508577675 posted

     I am still at the junior level of web development .   I have been wrestling with web services technology/techniques for part of 2010 - learning how to create/consume/deploy...  I have also been experimenting with third party web controls from ComponentArt.  In some of the samples from ComponentArt I observed that they use .asmx files locally to populate their custom data controls (datagrids, comboboxes, treeview controls...).  What is interesting (and a little bit confusing to me) is that in the ComponentArt samples they reference the web services directly within their controls in the markup.   My question is if this can be done  normally with controls that ship with Visual Studio (any version -- I have em all 2005, 2008, 2010).   I ask this question because from VS I only know to reference web services by right clicking on the project in the solution explorer to add a web reference. 

    Here is the services tag used by ComponentArt

     <Services>
      <asp:ServiceReference path="FileExplorerTreeViewService.asmx" />
    </Services>

    Then in the property grid of a data control -- say a treeview control-- they reference the web service, and when the project is run -- the control is populated with data from the web service. 

    Do data controls from VS support this technique?   My other question is if there is a benefit to using a web service as a datasource for a control and what is this benefit?   What is the criteria for using a web service in this manner?

    Thanks

     

    Wednesday, January 5, 2011 2:35 PM

Answers

  • User511655918 posted

    it's not something I do a lot, so I can only speak from personal experience, but generally these sort of things are leveraged in client side operations a lot.  Where you are possibly trying to send data to a server without posting back the screen or without even doing an ajax postback. 

     

    here is an msdn article on them showing use of them with the asp scriptmanager.

     

    http://msdn.microsoft.com/en-us/library/system.web.ui.servicereference.aspx

     

    Another scenario that's similar, but wrapped in a lot more layers is silverlight controls consuming svc built into the same web applications they run in due to silverlight client access policies.

     

    In summary, I'd only do services as a source for controls if I had to provide client side functionality, otherwise I'd follow traditional datasource routes. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 5, 2011 4:51 PM

All replies

  • User511655918 posted

    it's not something I do a lot, so I can only speak from personal experience, but generally these sort of things are leveraged in client side operations a lot.  Where you are possibly trying to send data to a server without posting back the screen or without even doing an ajax postback. 

     

    here is an msdn article on them showing use of them with the asp scriptmanager.

     

    http://msdn.microsoft.com/en-us/library/system.web.ui.servicereference.aspx

     

    Another scenario that's similar, but wrapped in a lot more layers is silverlight controls consuming svc built into the same web applications they run in due to silverlight client access policies.

     

    In summary, I'd only do services as a source for controls if I had to provide client side functionality, otherwise I'd follow traditional datasource routes. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 5, 2011 4:51 PM
  • User508577675 posted

    Many thanks for your response.  It was very enlightening and encouraging.  BTW, I left out the <scriptmanager> tags that enclosed the <services> tags in my original post.  I'm still kinda old school on need to have a connection to a physical DB on a physical server.  But I think it is very cool how you can also use a web service within the webpage as a datasource.

    I went to the link you provided (thank you very much).  The example looks very cool, and I would like to try it out (on VS10).  Is there a scripts.js file to go with this example anywhere?   How about the webservice.asmx.cs?  Is there a webservice.asmx to go with this?  I looked around but did not see it.  I would really like to try out that example -- as eventually I would like to step up to Silverlight.

    Thanks again for the response.

    Wednesday, January 5, 2011 5:38 PM
  • User508577675 posted

    I found the .asmx and .js files for the example by clicking on a few more links within the original link.  Great stuff - easy learning. 

    Wednesday, January 5, 2011 6:46 PM