Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
navds
Creator II
Creator II

Working with tXMLRPCInput

I want the following input in my tXMLRPCInput:

<methodCall>
    <methodName>execute</methodName>
    <params>
        <param>
            <value><string>dbname</string></value>
        </param>
        <param>
               <value><int>2</int></value>
        </param>
        <param>
               <value><string>fou</string></value>
        </param>
        <param>
            <value><string>some.module</string></value>
        </param>
        <param>
            <value><string>some_method</string></value>
        </param>
        
        <!-- params -->
        <param>
            <param>
            	<value><string>some.model_name</string></value>
            </param>
            
            <param>
            	<value><string>another_param</string></value>
            </param>
        </param>
    </params>
</methodCall>

I didn't find any example on how to use multi-dimensional value (struct, map, list, etc) for this component. Any clue?

 

Thanks.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

OK, well looking at the structure I would try out the java.lang.Object[].class option and create a String[] of your values in Java. Save that in the globalMap and reference that in the component. For example....

 

String[] array = { "hello", "world", "how",
    "are", "you" };
globalMap.put("array",array);

 This works perfectly using this useful site for testing this sort of stuff out ....

http://phpxmlrpc.sourceforge.net/server.php?methodName=interopEchoTests.echoStringArray

 

 

View solution in original post

5 Replies
Anonymous
Not applicable

You can do this by using the Java classes that are specified for each parameter. So for a Map (for example), you can build your map data in a tJava like so....

 

java.util.Map map = new java.util.HashMap();
map.put("name", "James");
map.put("age", 23);
map.put("address", "12 Baker Street");

globalMap.put("map_data", map);

The map is added to the globalMap so that you can use it anywhere in the job. When you get to your tXMLRPCInput component, your map parameter will be set up with a class value of "java.util.Map.class" and your value will be....

globalMap.get("map_data")
navds
Creator II
Creator II
Author

Thanks but the structure don't look like a map, didn't work. I tried Vector<Object> too but didn't work, List neither. Unfortunately, there is no way to print out the data sent for debugging purpose.
I am out of idea now 0683p000009MPcz.png
Anonymous
Not applicable

What does the structure look like? Can I see the documentation anywhere? The structure example you posted I am not sure is a valid structure since I do not believe that a <param> element can contain a <param> element. I assumed that it was an example of the type of thing you wanted to achieve.

navds
Creator II
Creator II
Author

The structure above is correct and it works in Postman. The second param is the argument of the method some_method.
Anonymous
Not applicable

OK, well looking at the structure I would try out the java.lang.Object[].class option and create a String[] of your values in Java. Save that in the globalMap and reference that in the component. For example....

 

String[] array = { "hello", "world", "how",
    "are", "you" };
globalMap.put("array",array);

 This works perfectly using this useful site for testing this sort of stuff out ....

http://phpxmlrpc.sourceforge.net/server.php?methodName=interopEchoTests.echoStringArray