Question

Use Json from FME server in web app

  • 20 December 2018
  • 2 replies
  • 2 views

Badge +2

Hi,

From the documentation on https://playground.fmeserver.com/ I have made a web interface where my goal is to initiate a workspace on the server and then use the json output in a javascript foldertree.

 

I have one published parameter that specifies the ID of the webfolder I want to re-create as json.

 

Everything works as can use the json output directly by saving it as a file set is a source in my foldertree but I can't get it to work when using the streaming service and using the the URL as source.

 

I specifically tried using the streaming service as in the https://playground.fmeserver.com/javascript/data-visualization/mapbox/ example but the data isn't read from the foldertree javascript.

 

 

I lack the basic programming insight but I suspect I will need to use jsonp to make this work? Or is there a better way to do this overall?

 

 

 

Thanks!

 

 

/Jacob

2 replies

Just a general suggestion, if you are working with JSON, Please validate your JSON first.

 

Here are few tools I which helps

https://jsonformatter.org

https://codebeautify.org/jsonviewer

Badge +7

Hi @j2,

 

 

Sounds like a cool app. Can you verify that the datastreaming URL is indeed returning JSON to your application? One way to do this is simply accessing the URL in your browser and see if you receive data. If datastreaming is working, there is likely something missing on the folder tree side. Are you using a plugin or plain JS for that? If you have access to your browser's developer tools, do you see any errors in the console or network tabs when you click on items in the tree?

 

Hope this helps,

Nathan

Reply