Webservice XML response results in array values

Hi All,
I have onboarded webservice connector and try to do the entitlement and account aggregation but the results end in array. But i want each value should be an entitlement. Also the xpath is giving the results when tested with Xpath finder tool.

In the rootpath i have given //MyTableName and response mapping mapped the ID and Description as /Description and /ID. Any idea how to resolve this?

Thanks,
Shantha Kumar

Hi @Santhakumar,

If you include root path in the configuration properly then the array list itself will be treated as separate object by connector and you will get multiple entitlement.

Can you share the mapping and the root path configuration?

Thanks

Hi @Santhakumar

Comparing with a working connector I have in some tenant, Rootpath should be the complete path up to the container element (MyTableName), in your case //…/diffgr:diffgram/DocumentElement/MyTableName (complete … with the path to the root of your XML, which is not visible in the image). Do not foget to include the namespaces in configuration, I remember to have some error once I omitted them. Note that only at the beggining of rootPath you have to configure double bar (//), following must be simple bars (/), as I wrote before.

In your response mapping, XML element (ID and Description) must be on the Attribute Path column, without other character (Just ID and just Description). In the left column, the corresponding name you defined on schema for these fields.

Hope this helps!

We already tried this method @jsosa it’s not working

Hi @ashutosh08 @jsosa I have tried WebServiceAfterRule to match rawResponse data to get single value but getting below error for the rule.

image

Here is the rule did i miss something??


Hi @Santhakumar,

As per error it says about XPATH exception. Could you please check and validate the code locally that whether your code is able to parse the XML and then deploy the change in the environment.

It will become difficult if you are directly debugging in the environment.

Thanks

Hi Shantha, I do not see anything bad at a glance. It would be helpful if you put some logger lines along the code. At least to see the rawResponseObject string version, and perhaps iterate on accountListMap before returning, and make some logger calls. Then paste here the ccg.log generated (remember to activate log for webservices connector on the log4.properties).

You can use log object, already available at the beginning of code, with info, error, warn, debug, etc, the same as configured on the log4j properties file.

@ashutosh08 Is there any tool to validate this like RDK or VSCode?

@jsosa will try and let you know :+1:

Hi @Santhakumar,

This is a logical issue and so the validation can be done in any of your preferred editor.

Thanks

Resolved after created the WebService AfterOperation Rule and populate the raw response with schema attributes.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.