Skip to main content
Question

I have been asked to replace a python program that logs into a website and download a text file with an FME solution. I was given the working python application and, using the HTTPCaller Transformer, along with the Creator Transformer.


robertgilley
Contributor
Forum|alt.badge.img+5

Although the Python can connect with the information provide, the FME tries to connect but is not able to. This is simply downloading a text file from the site once the connection is made and storing the text file locally.

The goal is to modify the process that currently uses three software packages into one FME solution.

 

Details on the HTTPCaller in the attachment

14 replies

hkingsbury
Celebrity
Forum|alt.badge.img+55
  • Celebrity
  • March 30, 2023

Not much we can tell from that screenshot, whats the error that you're getting? from both the log and the _response_body attribute


redgeographics
Celebrity
Forum|alt.badge.img+50

In addition to what @hkingsbury​ said: does the website you're calling require any kind of authentication?


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023
hkingsbury wrote:

Not much we can tell from that screenshot, whats the error that you're getting? from both the log and the _response_body attribute

Here are the errors I am getting. I can supply the complete Informational log if needed:

HTTPCaller_2 (HTTPFactory): HTTP/FTP transfer error: 'Couldn't connect to server'

HTTPCaller_2 (HTTPFactory): Please ensure that your network connection is properly set up

HTTPCaller_2 (HTTPFactory): No proxy settings have been entered. If you require a proxy to access external URLs, please ensure the appropriate information has been entered

 

I have been advised that the Python code that is being used is actually getting to the site and downloading the file. I can supply that as well if it helps.

 


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023
redgeographics wrote:

In addition to what @hkingsbury​ said: does the website you're calling require any kind of authentication?

The developer of the Python has told me that no authentication is required, other than the information in the Python itself. I am a little hesitant to supply the actual Python in an open forum but will send a mock-up of the parameters if that will help?


redgeographics
Celebrity
Forum|alt.badge.img+50
robertgilley wrote:

Here are the errors I am getting. I can supply the complete Informational log if needed:

HTTPCaller_2 (HTTPFactory): HTTP/FTP transfer error: 'Couldn't connect to server'

HTTPCaller_2 (HTTPFactory): Please ensure that your network connection is properly set up

HTTPCaller_2 (HTTPFactory): No proxy settings have been entered. If you require a proxy to access external URLs, please ensure the appropriate information has been entered

 

I have been advised that the Python code that is being used is actually getting to the site and downloading the file. I can supply that as well if it helps.

 

The errors indicate FME can't connect to the server. So some questions come to mind:

 

  • Can you ping that server?
  • Do you need to use a proxy?
  • Is the python code able to get the data if you run it from the same machine (and user account) as FME?

 


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023
robertgilley wrote:

Here are the errors I am getting. I can supply the complete Informational log if needed:

HTTPCaller_2 (HTTPFactory): HTTP/FTP transfer error: 'Couldn't connect to server'

HTTPCaller_2 (HTTPFactory): Please ensure that your network connection is properly set up

HTTPCaller_2 (HTTPFactory): No proxy settings have been entered. If you require a proxy to access external URLs, please ensure the appropriate information has been entered

 

I have been advised that the Python code that is being used is actually getting to the site and downloading the file. I can supply that as well if it helps.

 

I will try to ping the server, but the python developer advised that he was receiving the file, without needing a special account or anything done with a proxy. But I will try.


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023

Here is the full Pyton code that is currently downloading the file (specific location info is replaced):

 

import requests

headers = {'PAYMENTS_DIRECTORY_ORG_ID':'099000099', 'EPAYMENTS_DIRECTORY_DOWNLOAD_CD':'9x99999abc-9999-9999xxx-a99999999999'}

directory = 'https://QQQ.org/PaymentsDirectory/directories/fedach?format=text'

r = requests.get(directory, headers = headers)

open("QQQ.txt","wb") .write(r.content)

 


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023

I am using default values. I have tried modifying colons, and quotes but still getting the inability to connect

HTTPCallerSetup


redgeographics
Celebrity
Forum|alt.badge.img+50
robertgilley wrote:

I am using default values. I have tried modifying colons, and quotes but still getting the inability to connect

HTTPCallerSetup

Have you tried pinging the server? Does the Python work on the same machine/account as you're using FME on?


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023
redgeographics wrote:

Have you tried pinging the server? Does the Python work on the same machine/account as you're using FME on?

I don't know the IPAddress. It is a government site. The guy running the Python downloaded the file earlier this morning. He advised that there is a limit of 5 downloads per day.

I could try to run the Python from my machine. Let me do that.


redgeographics
Celebrity
Forum|alt.badge.img+50
redgeographics wrote:

Have you tried pinging the server? Does the Python work on the same machine/account as you're using FME on?

You don't need to know the ip address to ping, you can use the url as well. If that doesn't work (i.e. if you don't get a response from the server) it most likely means your computer can't reach the server.


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023
redgeographics wrote:

Have you tried pinging the server? Does the Python work on the same machine/account as you're using FME on?

Thanks. I had tried the url and it didn't work. I tried to run the Python from my PC and that timed out as well. I am going back to the Python programmer to see if i have to register myself or the machine on the site to reach it.


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • March 31, 2023
redgeographics wrote:

Have you tried pinging the server? Does the Python work on the same machine/account as you're using FME on?

I tried to ping with the url and got no response. I ran the Python script from my machine and that time out as well. I am going back to the Python programmer to see if I have to register myself or my machine on the website to allow downloads. That has not been mentioned so far but it might be the answer.


robertgilley
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • April 10, 2024

After all was said and done, and starting to doubt the local contact’s information, I contacted the vendor and learned that I was given the wrong login information locally.  Once I got the correct login information, the issue was resolved.


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