jaystack / jaydata

Notice: this library isn't maintained anymore
http://jaydata.org
GNU General Public License v2.0
352 stars 95 forks source link

newby question about xml:root #194

Open ghost opened 10 years ago

ghost commented 10 years ago

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 commented 10 years ago

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

robesz commented 10 years ago

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

robesz commented 10 years ago

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
ghost commented 10 years ago

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

robesz commented 10 years ago

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.

xaviguardia commented 9 years ago

Hello robesz, is there any other solution ?

milespoindexter commented 9 years ago

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

robesz commented 9 years ago

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.

lazarv commented 9 years ago

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!