Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Consuming external webservice on screens

Posted on by Microsoft Employee

Hi,

I am looking for some help around customizing my screen to consume external web service. I do have customwebapp code that am starting with. Any sample that would consume an external webservice within screens would be of help.

Thanks,
Fren

*This post is locked for comments

  • Suggested answer
    Apps Mexico Profile Picture
    Apps Mexico 1,090 on at
    RE: Consuming external webservice on screens

    Hi,

    Today, I don't have time to do a CRUD example, but for now this can help you.

    Thanks to http://www.ediy.co.nz/vbjson-json-parser-library-in-vb6-xidc55680.html

     

    Download file http://appsmexico.mx/shared_folder/vb6_json.rar

     

    Add reference to:

    C:\Windows\System32\msxml6.dll (Microsoft XML)

    C:\Windows\System32\scrrun.dll (Microsoft Scripting Runtime)

    C:\Program Files\Common Files\System\ado\msado.15.dll (Microsoft ActiveX Data Objects)

     

    Add objects to proyect:

     

    JSON.bas

    cJSONScript.cls

    cStringBuilder.cls

     

    ThisScreen:

     

    Option Explicit

     

    Private Sub CNumber_Chk(ChkStrg As String, retval As Integer)

        Dim vXmlHttp As MSXML2.XMLHTTP

        Set vXmlHttp = New MSXML2.XMLHTTP

       

        Dim vWebServiceUrl As String

        Dim vResponse As String

       

        vWebServiceUrl = "http://vmwamdeveloper/un-mx.net/WebServices/rest/Pantallas/GetPantallaById?pantallaId=" & ChkStrg

       

        Call vXmlHttp.open("GET", vWebServiceUrl, False)

        vXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

        Call vXmlHttp.send

       

        vResponse = vXmlHttp.responseText

       

        Dim vPantalla As Object

       

        Set vPantalla = Json_Deserialize(vResponse)

       

        Call SetObjectValue("cName", vPantalla.Item("Nombre"))

       

        Set vXmlHttp = Nothing

       

    End Sub

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Consuming external webservice on screens

    Hi Juan Carlos,

    Thank you for your reply.

    we are planning to consumre REST services, want to customize standard screens and perfrom CRUD operations and displaying data on the screen.

  • Apps Mexico Profile Picture
    Apps Mexico 1,090 on at
    RE: Consuming external webservice on screens

    Hi Fren,

    I think that we need more info about what you really needs.

    • Your web service is REST or SOAP?
    • You want to customize a stardard Dynamics SL with customize mode or you develop a new screen with SL SDK?
    • What do you want to do with the data getting from ws?
      • CRUD operations?
      • Just display data?

    Regards.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans