Input Dictionary type for a webservicequery()

In my webservice I have input data is like mentioned below.

 

 -service(service)

     -request(request)

          -ws-input-header(ws-input-header)

                 calssname : "Sample" [text]

                  systemname : "myorg" [text]

          -ws-input(ws-input)

                 -data-cdt(data-cdt)

                            input1 : "133" [text]

                            input2 : "Test Data" [text]

 

I am having a service which accepting the input in the above format. We are able to call it successfully from "Call Web Service" smart service. But I want to call this through "webservicequery()".   I know it is not best practice to use nested CDT's. But it is my requirement.

Can anybody suggest the way to call this service from SAIL. 

Thanks in Advance

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    What exactly are you having trouble with? One of the parameters of webservicequery() is "inputVar" which is a dictionary of inputs, which is what you want to pass. For example: webservicequery(yourConfig, {input1: "133", input2: "Test Data'})
  • Hi Josh,

      My input is not simple dictionary,In the above example I have mentioned the structure of that dictionary.  

    Parent CDT : service(service)

        Child CDT of service(service)  is request(request) CDT

       Child CDTs of request(request) is ws-input-header(ws-input-header) and ws-input(ws-input)

               In  ws-input-header(ws-input-header) CDT we have two variables calssname : "Sample" [text] and systemname : "myorg" [text].

             In ws-input(ws-input) CDT we have another Child CDT as data-cdt(data-cdt).

            In data-cdt(data-cdt) CDT we have two variables   input1 : "133" [text] and input2 : "Test Data" [text]

      So asper the above structure I need to pass the input for calssname , systemname , input1 and input2 .

    But I can not pass them directly as you mentioned in your example " webservicequery(yourConfig, {input1: "133", input2: "Test Data'})" . I must follow the entire structure to use each variable.

        In "Call web service" node I am able to configure them in the "Input" Section. But how to do the same in "webservicequery()" rule.

     

    Note : Highlighted in "Red" color are CDT names(They are nested). Highlighted in "Bold" are the variables of child CDT's which we need pass them values for Input to Webservice.

  • 0
    Certified Lead Developer
    Can you share the Smart service node configuration (Specially Setup as well as Input under Data Tab) through which you are able to call the service and please share the Rule where you have used webservicequery() so that we can troubleshoot the issue
  • 0
    Certified Lead Developer
    in reply to venkannak
    Can you do something like: webservicequery(yourConfig, {calssname: ri!serviceCDT.requestCDT.ws-input-headerCDT.calssname, systemname: ri!serviceCDT.requestCDT.ws-input-headerCDT.systemname, input1: ri!serviceCDT.requestCDT.ws-input.data-cdt.input1, input2: ri!serviceCDT.requestCDT.ws-input.data-cdt.input2})?

    Note: I used dot notation here to make it easier to read but you should opt for index() over dot notation.