Skip to main content
Question

Use Json from FME server in web app

  • December 20, 2018
  • 2 replies
  • 23 views

jatoxa
Contributor
Forum|alt.badge.img+12

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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

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


nathanatsafe
Safer
Forum|alt.badge.img+9
  • Safer
  • 284 replies
  • December 24, 2018

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