jaydata icon indicating copy to clipboard operation
jaydata copied to clipboard

newby question about xml:root

Open ghost opened this issue 11 years ago • 9 comments

Hi, I am just trying jaydata today for the first time and have an odata service now running that presents documents from my MongoDB collection, without any changes needed to my documents.
But the resulting xml/json has one big problem. part of the URI has the word "undefined". example: xml:base="http://localhost:3012undefined/Products"

This is after following this example very closely: http://jaydata.org/blog/install-your-own-odata-server-with-nodejs-and-mongodb

Is there a simple fix for this?

ghost avatar Sep 02 '14 20:09 ghost

To add a bit to this, the links work great. But it seems that the URI path used when I set up express do not get passed to the object handling the request.

So links to the objects work like: http://localhost:3012/test/Products('NTQwNjAxOWMxMTcyZDVjMWQxNDMwZTRl')

but the handler just puts undefined instead of /test every time, in the resulting xml/json

ghost avatar Sep 02 '14 20:09 ghost

Hi Miles, could you please paste here the client code that instantiates the OData context?

robesz avatar Sep 03 '14 05:09 robesz

no need to paste the context :) you can downgrade to express version 3 and the issue will be solved. You can do this by the following instruction:

npm install express@3

robesz avatar Sep 03 '14 07:09 robesz

downgrading to Express 3 (from 4.8.7) Worked!! Thank you for responding so quickly! I was not getting anywhere with reading the API and was going to try to look at the source code but I'm not very good with Javascript. Can I copy your answer to the other forum question on jaydata.org so before closing that discussion? (In can others look for the answer there via google) Also, if you need any help testing new jaydata releases to work with express4.x let me know. We are starting to add a lot of odata services now that MS PowerBI is getting used more here (for better or worse) and I really like how jaydata lets me adopt my documents in MongoDB to odata.

miles

ghost avatar Sep 03 '14 12:09 ghost

Splendid, thank your for your feedback and sharing your plans with our component. I close this issue, but feel free to reopen it or create a new one, keep in touch about your project and further releases.

robesz avatar Sep 03 '14 14:09 robesz

Hello robesz, is there any other solution ?

xaviguardia avatar Nov 04 '14 23:11 xaviguardia

Yes, is there any ETA on the next version of Jaydata which will hopefully support the latest version of Express?

milespoindexter avatar Nov 05 '14 18:11 milespoindexter

Hi guys, The updated version with new express support will arrive in a couple of days! :) Stay tuned, someone from the team will update this ticket to notify you.

robesz avatar Nov 09 '14 14:11 robesz

Hi, just published odata-server 1.3.7 supporting Express 4 to the npm registry. It's a much better and easier way to publish your OData service. Read more about JayData Server here: http://jaydata.org/blog/how-to-set-up-a-nodejs-odata-endpoint-with-odata-server JayService fix will be coming in the next release of JayData. Stay tuned!

lazarv avatar Nov 12 '14 08:11 lazarv