Skip to main content
Question

IFS Connect thinks text/xml response is binary

  • December 5, 2022
  • 8 replies
  • 326 views

Forum|alt.badge.img+10

I’m calling a REST service (an RSS feed, actually, updated daily) that returns an XML response which I want transform and pass on to a projection, but the application message keeps failing with an error:

Error while preparing input data. Caused by: ifs.fnd.base.SystemException: Attempt to use an XSL transformer (C_RBA_RSS_TO_IFS_CURR_RATE) on binary data

 

Has anyone experienced the same and know a way around it?

FYI, I’ve tried to set a a header on the REST routing address - Accept: text/xml - but that made no difference.

8 replies

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 880 replies
  • December 6, 2022

Hi @AussieAnders,

 

Check your REST service with postman and ensure that the response contains Content-Type: application/xml header. If it’s not present or have a different content type, that could be the problem.

Most of the time, setting the Content-Type in the request would solve the problem. If it doesn’t work, maybe you could create a java transformer so this exception would not occur.

 

Regards,

Damith

 


Forum|alt.badge.img+10
  • Author
  • Hero (Partner)
  • 126 replies
  • December 7, 2022

It returns Accept: text/xml even if I pass application/xml in the request. Still XML, but nonetheless, can IFS Connect be confused by that?

I also tried to pass Accept-Encoding: "" to make sure I don’t get a compressed response, but that made no difference.

I have also tried a Java transformer, but get the same error.

FYI, on IFS Applications 10 I used a work-around by saving the response to a file using path %FILE_OUT%\..\in, so that the IFS Connect default file reader would pull it right back in again, and then I could apply my transformer. On IFS Cloud I need server access to set up absolte file paths though, so I’d rather not work with files.


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 880 replies
  • December 7, 2022

Hi @AussieAnders ,

 

I think IFS Connect determines whether it’s XML or binary from the Content-Type header, not the Accept header. What value you get in the Content-Type header in your response?

Regards,

Damith


Forum|alt.badge.img+10
  • Author
  • Hero (Partner)
  • 126 replies
  • December 7, 2022

Whoops, did a typo there. The service (actually an RSS feed) returns Content-Type: text/xml in the response.

I tried passing Accept: application/xml in the request, but it still returns Content-Type: text/xml in the response.

Still, that is XML, but IFS Connect just doesn’t understand that.


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 880 replies
  • December 7, 2022

Hey,

 

Content-Type: text/xml should work. But I’m now talking about incoming XMLs through soapgateway, not the XML coming from a response. Can you send a screen capture of your routing rule and the error in the application message?

 

Regards,

Damith


Forum|alt.badge.img+10
  • Author
  • Hero (Partner)
  • 126 replies
  • December 7, 2022

Yeah, I think it’s because I’m using the REST sender that IFS Connect doesn’t understand that it’s getting a response back.

I’m trying to automate fetching of currency rates from an RSS feed on the Internet. First step is a schedule migration job where I use an event action to create an outbound application message. It’s just a dummy message to invoke a GET using the REST connector. I then want to capture the response, transform it, and pass it to the standard projection for receiving currencyt rates in IFS Cloud. My routing rule below:

The error I’m getting is: Error while preparing input data. Caused by: ifs.fnd.base.SystemException: Attempt to use an XSL transformer (C_RBA_RSS_TO_IFS_CURR_RATE) on binary data

I can download the response though, and have verified by opening in Notepad++ that I’m getting the expected XML and that the encoding is UTF-8.

Currently, my XSL transformer is on the 2nd address in the link, but I’ve tried putting it as response transformer on my 1st address.

On IFS Applications 10 I have used the workaround of saving the response to the default input directory for IFS Connect’s file reader, so I get a second application message that processes just fine. That’s a bit harder to set up with IFS Cloud though, so I’m trying to avoid working with files.

Also, I’m trying to make this configuration only.


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 880 replies
  • December 8, 2022

I did some testing similar to your setup and it seems the input to chain link 2 is always binary regardless of the content type in chain link1. I think it could be a bug in routing :<

However, if you create a java transformer of type binary, then you could process the content and convert to json required by the projection.

 

Otherwise, you could create a workflow to perform the same thing. I suppose you could use the finCurrencyTypeUpdate workflow as a template and change according to your need.

 

Cheers!

Damith


Forum|alt.badge.img+10
  • Author
  • Hero (Partner)
  • 126 replies
  • December 14, 2022

Thanks Damith. I think I need to explore the Workflow option.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings