Skip to main content
Solved

HTTP Caller won't work with XML Templater

  • December 19, 2019
  • 6 replies
  • 18 views

Forum|alt.badge.img

I have created a workbench to request an ID with a fake XML. This works for one ID.

 

I've now added in an xls and an attribute manager to attempt to edit the XML that requests the IDs to request multiple ID's.

This will not work, it keeps rejecting it.

My XML is set to:

Rejection:

Please help me get this working.

Best answer by daveatsafe

Hi @kimburrows1242,

In the templater, please place the cursor between the empty quotes for each attribute, then double-click the attribute name under FME Feature Attributes on the left, to place the attribute reference in the template:

View original
Did this help you find an answer to your question?

6 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

HTML error code 500 is rather generic I'm afraid. But if I understand you correctly it does work if you require a single ID and fails when you're sending multiple requests in sequence.

One thing I would try is add a Decelerator before doing the HTTP call, this slows FME down so as to not overload the external service (many of them have usage limits in place that prevent you from doing too many requests in too short an amount of time). Since the HTTPCaller fires off one request per feature that's passing through you're likely to hit those limits.


Forum|alt.badge.img
redgeographics wrote:

HTML error code 500 is rather generic I'm afraid. But if I understand you correctly it does work if you require a single ID and fails when you're sending multiple requests in sequence.

One thing I would try is add a Decelerator before doing the HTTP call, this slows FME down so as to not overload the external service (many of them have usage limits in place that prevent you from doing too many requests in too short an amount of time). Since the HTTPCaller fires off one request per feature that's passing through you're likely to hit those limits.

I'm afraid that just rejected them more slowly.

When I run on a single ID I do it using a Creator, not the spreadsheet, but I've used the attribute manager to alter the spreadsheet to fit the XML Location headers. So I figured it should work but no luck. I think I'm missing a trick somewhere with the Templater to trigger it to format the XML properly, maybe?


redgeographics
Celebrity
Forum|alt.badge.img+49
kimburrows1242 wrote:

I'm afraid that just rejected them more slowly.

When I run on a single ID I do it using a Creator, not the spreadsheet, but I've used the attribute manager to alter the spreadsheet to fit the XML Location headers. So I figured it should work but no luck. I think I'm missing a trick somewhere with the Templater to trigger it to format the XML properly, maybe?

Dang it... well next step is to take a close look at that XML you're passing through, compare your first (working) one with the second one and see where the differences are. Ideally, test it with the same id value.

Forum|alt.badge.img
redgeographics wrote:
Dang it... well next step is to take a close look at that XML you're passing through, compare your first (working) one with the second one and see where the differences are. Ideally, test it with the same id value.

It's the same XML, but I'm triggering it with the spreadsheet now with the idea that it will change the info to trigger the request for the next ID. Before it just used a Create transformer.


Forum|alt.badge.img

I have made movements on this but its not using the actual information from the xls

 

This is my XML

 

I have int he Attribute Manager ensured all of the above titles are the same, but it won't use the information.

 

My result is:


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • December 19, 2019

Hi @kimburrows1242,

In the templater, please place the cursor between the empty quotes for each attribute, then double-click the attribute name under FME Feature Attributes on the left, to place the attribute reference in the template:


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