Skip to main content

I have been working on this challenge of using two HTTPCallers to update the assets' spatial data in the AMS (Asset Management System) via an API in the form of uploading the GeoPackage files into AMS.

 

And here how the two HTTPCallers are set up:

 

The first HTTPCaller uploads the GeoPackage file into AMS and in that process, it has to save a string value in the "_response_body" attribute in the FME Workspace - However, at this stage the upload is not working at all due to lack of the string value in "_response_body".

 

Then the second HTTPCaller takes the string value in "_response_body" as a Job ID to do the validation of the file and after that begin importing of the data. And therefore, if the first HTTPCaller can't return a string value in the "_response_body", neither upload nor import of the GeoPackage happens.

 

When I tested the API in Postman, it works as expected.

Hello deob

Can you provide more details e.g. how your wstup of the HTTPCaller is and how the string that should be provided should look like.

 


Hello! An image of the HTTPCaller setup (as @tshoppenhof suggested) could be helpful for quick troubleshooting.

 

I suspect that the first HTTPCaller is failing to either connect or authenticate with the AMS. For other issues, like an invalid asset ID, I'd expect to see some response in that attribute.

 

Are there other attributes returned to the AMS? For example "_error", "_http_status_code", or "_fme_rejection_code". Those attributes will sometimes contain a specific error message. As well, you may receive a failure message through the HTTPCaller's failure ("<Rejected>") OR success ("Output") ports. There is an overview of troubleshooting AMS errors in the HTTPCaller https://community.safe.com/s/article/Custom-Requests-for-Cityworks#Troubleshooting" alt="https://community.safe.com/s/article/Custom-Requests-for-Cityworks#Troubleshootinghttps://community.safe.com/s/article/Custom-Requests-for-Cityworks#Troubleshooting" target="_blank">in this tutorial.

 

Let us know how it goes! Thank you.


Hello deob

Can you provide more details e.g. how your wstup of the HTTPCaller is and how the string that should be provided should look like.

 

Hi Tschoppenhof,

No problem, please see attached the screengrabs of AMS, FME and postman.

Thanks for the reply.

Regards,


Hello! An image of the HTTPCaller setup (as @tshoppenhof suggested) could be helpful for quick troubleshooting.

 

I suspect that the first HTTPCaller is failing to either connect or authenticate with the AMS. For other issues, like an invalid asset ID, I'd expect to see some response in that attribute.

 

Are there other attributes returned to the AMS? For example "_error", "_http_status_code", or "_fme_rejection_code". Those attributes will sometimes contain a specific error message. As well, you may receive a failure message through the HTTPCaller's failure ("<Rejected>") OR success ("Output") ports. There is an overview of troubleshooting AMS errors in the HTTPCaller https://community.safe.com/s/article/Custom-Requests-for-Cityworks#Troubleshooting" alt="https://community.safe.com/s/article/Custom-Requests-for-Cityworks#Troubleshootinghttps://community.safe.com/s/article/Custom-Requests-for-Cityworks#Troubleshooting" target="_blank">in this tutorial.

 

Let us know how it goes! Thank you.

Hi Sanaeatsafe,

Thanks for the suggestions.

No other attributes returned to AMS except the Asset IDs in the first http caller and it doesn't give any errors (as shown in the screengrabs in reply to @tschoppenhof about this) apart from showing that everything is okay. But the second http caller rejects the results from the first http caller probably due to lack of the response body message (I presume that's what it all about).

Any idea where I may be going wrong in setting up the first http caller as per screengrabs?

Regards,


Hi Tschoppenhof,

No problem, please see attached the screengrabs of AMS, FME and postman.

Thanks for the reply.

Regards,

Hi deob

What I see is, that the contentType in Postman and in the HTTPCaller are different. Second why is the UploadBody in the HTTPCaller empty isn't there input which to deliver to the API. And lastly I dont see where you ad the geopackage file or the the path to it so that it can be uploaded.


Hi @tschoppenhof​ ,

I have set the Content-Type to match exactly what is in Postman and specified the file to be uploaded as shown in the attached picture below and then re-run the process, however, nothing gets uploaded into AMS regardless what the attached log file says.

I noticed that when "Upload Data" option set to "Upload From File" the "Upload Body" tends to be greyed out (whereby it doesn't accept any input for this option).

Regards,


Hi @tschoppenhof​ ,

I have set the Content-Type to match exactly what is in Postman and specified the file to be uploaded as shown in the attached picture below and then re-run the process, however, nothing gets uploaded into AMS regardless what the attached log file says.

I noticed that when "Upload Data" option set to "Upload From File" the "Upload Body" tends to be greyed out (whereby it doesn't accept any input for this option).

Regards,

Hi deob

I still think there has to be a difference in the settings. Especially in the Upload Body. How does the Tab "Body" in Postman look like?


Reply