html client custom execute code to call web service RRS feed

  • Question

  • I am new to Lightswitch and was hoping there is a quick walkthrough on how to call a webservice from a button on the html client that passes the data items on the screen to the service call to create a business record in the LOB application.


    Thursday, September 19, 2013 5:49 AM


All replies

  • Do you want to use a webservice to create a record inside the LightSwitch app? Why would you do that? LightSwitch has everything on board to do that.

    For other types of communication from the client: 

    Web api is the LightSwitch html client bests friend. (web services is kind of 20th century, no?)

    paul van bladel

    Thursday, September 19, 2013 6:08 AM
  • The web service is to create the record on the Line of Business Application. The web service is hosted by the LOB application as an integration point.

    In a nutshell what I am attempting to do is create a client for the LOB app using Light Switch.

    Light Switch html screen will facilitate capture of the data and can have its own database. 

    An event to interact with the LOB system will be triggered by a button click on the html screen for a particular entity eg. order-order items to post this record into the LOB app using the web service.

    The direction i'm looking for is how to map the button click execute code to my web service passing the current record to it and receiving a return value.

    Regards, Karanja

    Thursday, September 19, 2013 2:16 PM
  • Hi,

    I am newbie to Lightswitch too. I want to we can learn and help from each other. Regarding calling web service, I found a blog from Beth Massi, you can check it if it helps.

    Calling Web Services to Validate Data in Visual Studio LightSwitch


    In addition, there is a question about "LightSwitch HTML Client SOAP web service WCF RIA service" . I am not sure if it is helpful to you.

    Wednesday, September 25, 2013 1:49 PM
  • After a bit of tinkering i have succeeded in my task.

    Using Saving-Data-In-The-Visual-Studio-LightSwitch-HTML-Client-Including-Automatic-Saves as my lamp and daxdilip-how-to-consume-dynamics-ax-2012 as my path I am now able to create a custom service in AX2012 and write a html client to consume the service in Light switch.

    Thanks for all the pointers...now on to greatness :D

    ps. as soon as the end to end app is in first release will post an article.

    Regards, Karanja

    • Marked as answer by Karanja Monday, September 30, 2013 9:17 PM
    Monday, September 30, 2013 9:17 PM