-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OData v2 support #143
Comments
I don't know. I'm not familiar with v2. I'll have a short look at what's changed. What product are you connecting to? |
Can you give me your v2 metadata to see what the differences are? |
Thanks for the response @davidmoten. Unfortunately, I'm not sure that I can give you the metadata for my specific service due to its licensing, but I found another sample OData v2 service online here: https://services.odata.org/V2/OData/OData.svc/$metadata The main difference between it and mine seems to be the version of the schema XML namespace used for the |
Upon investigation: I was getting an NPE here: Line 101 in 7468161
This could be a bug or a misconfiguration error on my part (even if it's a misconfiguration error, I'd consider it a bug that the diagnostics aren't more useful). I'll continue to investigate. |
V2 does look very similar. You might be able to modify the metadata file to make it comply with V4 and then use the generated client. The xml namespace will be important. You will want to modify the namespaces to look like this simple example in V4: The null pointer is probably because you are loading a file with a root element of a completely different namespace and the |
Thanks for the response David. I've come to a similar conclusion. I'm having a bit of a play with it at the moment. There were two causes of the NPE. One of them I reported in #145. The other is I think due to the reason that you specified. I managed to track down XSD files for OData v2; I'll see if these can be incorporated. Otherwise, munging my xml to make it look like OData v4 might work. |
Here is the definitive reference for the differences between OData 2 and 4: http://docs.oasis-open.org/odata/new-in-odata/v4.0/cn01/new-in-odata-v4.0-cn01.html
I've gone with the munging approach as a bit of an exploration. For my particular service, these are the sticking points that I have found so far:
It would be nice if this was more seamless, but I now have a schema that compiles and is hitting remote servers. Ready for the next hurdle! 😄 Thanks for your help @davidmoten . |
Nice work @kriegfrj ! |
This looks like a great generator, I particularly like the type safety. But unfortunately the server I need to connect to is OData v2. How hard would it be to modify the generator to generate v2 compatible clients?
The text was updated successfully, but these errors were encountered: