Skip to main content

We are trying to call the external rest API from the report rule but unfortunately don’t know how it will work.

If someone already tried then please share how we can set it up. 

We already have an external rest api and that is working. We want the same working from the report rule.

 

Report rule

 

Application message but in error

 

Thank you in advance for your help and support.

I have tried something similar and ended up getting success using the “SEND_XML_TO_CONNECT” logical printer. This could be used in combination with Report Rules.

By Using the SEND_XML_TO_CONNECT, i was able to apply a Routing Rule to route to a defined Routing Address. This gave more control over the sender, action, authentication.

 

The routing rule conditions looked like this:

 

I was testing with a simple endpoint in Power Automate and found that this worked via the HTTP_SENDER. Calling this endpoint using REST_SENDER was returning 400 Bad Request.

Other end points have worked with the REST_SENDER using this approach.


@Harley Thank you for your reply. Could you please send me the screenshot of the report rule that you set up for this case?

I want to check further to set up at my end after looking at those setups.

 

 

 


@SNBSHAN 

See below

This is working with a Report layout that uses the XML Plugin

<?xml version="1.0" encoding="UTF-8"?>
<report-layout>
<properties>
<version>0.1</version>
<layout-type>XML</layout-type> <!--SCRIPT,XSL,XML,EXCEL-->
<plugin-class>ifs.application.reportingservices.impl.extendedformatter.xmlplugin.XMLPlugin</plugin-class>
<output-method>BINARY</output-method> <!-- BINARY,FILE,E-MAIL-->
<output-extension>xml</output-extension>
<default-output-reference>
<binary></binary>
<file></file>
<e-mail></e-mail>
<e-mail-sender></e-mail-sender>
<e-mail-cc></e-mail-cc>
<e-mail-subject></e-mail-subject>
<e-mail-body>
<!!CDATAA
Email Body Content from the RPL
]]>
</e-mail-body>
</default-output-reference>
<full-xml>TRUE</full-xml>
<flattened-xml>
<enabled>TRUE</enabled>
<strongtyping>TRUE</strongtyping>
</flattened-xml>
<report-id>CUSTOMER_ORDER_IVC_REP</report-id>
<report-title>XML</report-title>
</properties>
<plugin>
<properties>
<!-- not used by this plugin -->
</properties>
<data>
<!-- not used by this plugin -->
</data>
<variables>
<!-- not used by this plugin -->
</variables>
</plugin>
</report-layout>

Not sure this is the best way to approach this, but it seems to be working.


@Harley

I am not sure how it works but I will test and let you know.

The xmll that you send it, is it the code of the file “XMLoutput.rpl” ?


Hi @SNBSHAN 

I think when you add OutputType and Message, it creates two payloads (Message input data in your application message) which could lead to the error.

Slightly different approach than @Harley mentioned which could work is to route to connect without any connector in the report rule

Then create a routing address and a rule to route to your rest endpoint and create a transformer to convert the report XML to the desired JSON format.

 

Hope it helps!

Damith


@Harley

I am not sure how it works but I will test and let you know.

The xmll that you send it, is it the code of the file “XMLoutput.rpl” ?

yes, that is the contents of XMLoutput.rpl


Thank you @dsj  and @Harley  for your answer.

I will first try and then will let you know.

 

 


Thank you both for your help and suggestion @dsj and @Harley .

I tried and it is working as expected.


Reply