Skip to content
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

Error:Adding OData Connected Service to the project failed: The 'Name' attribute is invalid #89

Open
bydamien opened this issue Jul 23, 2018 · 28 comments

Comments

@bydamien
Copy link

hello i am getting this error message when i try add xamarin forms application
Adding Nuget Packages
Generating Client Proxy ...
Error:Adding OData Connected Service to the project failed: The 'Name' attribute is invalid - The value 'ErpWeb365.ApiService' is invalid according to its datatype 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - The Pattern constraint failed.

@bydamien
Copy link
Author

nobody wants to help me ?

@unchase
Copy link

unchase commented Feb 19, 2019

I tried it in my own service. All good.
You can try my Unchase ODataConnectedService for solve this problem.

@gtrennert
Copy link

Hello unchase,
I have this error when trying to create an odata connected service to web service on page 21 (business central) :
Generating Client Proxy for OData V3...
Erreur :Échec de l'ajout de Unchase OData Connected Service au projet : Le schéma spécifié n'est pas valide. Erreurs :
(0,0) : erreur 0005: L'attribut 'Name' n'est pas valide - La valeur '_Balance_LCY_Payment_in_progress_LCY' n'est pas valide selon son type de données 'http://schemas.microsoft.com/ado/2007/05/edm:TSimpleIdentifier' - Échec de la contrainte Pattern.
Any Idea ?

@unchase
Copy link

unchase commented Aug 5, 2019

@gtrennert, сould you send the metadata file (or public URI) for the service to be added so that I can check the issue?
You can send it to me by email (see in my github profile).

@unchase
Copy link

unchase commented Aug 6, 2019

@gtrennert. OData library does not support a naming in form of "_Balance_LCY_Payment_in_progress_LCY", and the Connected service too.
If you can, try to rename this parameter without "_" in the beginning.

P.S. I removed the first "_" in "_Balance_LCY_Payment_in_progress_LCY" (in metadata file) => "Balance_LCY_Payment_in_progress_LCY" and it works!

@gtrennert
Copy link

I understand what you are saying, but I'm just testing web service access for Business central, its microsoft standard and I just don't understand why there is a leading underscore.
Web services in business central should work without any modification of standard tables (modifications which are no prohibited in this product)

@unchase
Copy link

unchase commented Aug 6, 2019

I agree. In any case, the client code generator cannot correctly handle this naming.

@gtrennert
Copy link

I will create a new page in which I will exclude all this fields beginning with _
Thanks a lot for your answers

@unchase
Copy link

unchase commented Aug 6, 2019

@gtrennert, you're welcome.

@nick-webbgh
Copy link

In Visual Studio 2017, on trying to add an OData Connected Service, I get the error below:-
Adding OData Connected Service to the project failed: The current schema element does not support text 'NAV.NavType/Real'. Any thoughts?

@unchase
Copy link

unchase commented Sep 11, 2019

@nick-webbgh, сould you send the metadata file to me by email? I will check the issue.

@nick-webbgh
Copy link

nick-webbgh commented Sep 12, 2019 via email

@unchase
Copy link

unchase commented Sep 13, 2019 via email

@nick-webbgh
Copy link

nick-webbgh commented Sep 16, 2019 via email

@gtrennert
Copy link

Hello again unchase,
I have the following issue - when configuring a metadata endpoint I get the following type of messages : see picture joined
02 message
As I may have many web services published with the path "https://bc190709:7048/NAV/OData/$metadata" I get many of this messages and after confirming the first ones I get errors. Is there a way to avoid this messages ?
I also tried to enter longer urls like https://bc190709:7048/NAV/OData/Company('CRONUS%20FR')/TestOdata but then I get error message :
03 cannot access

@gtrennert
Copy link

Here a better screenshot of all the messages :
04 messages multiple

@gtrennert
Copy link

even now that i deleted all other published webservices i have many popups like mentionned above

and second thing I wanted to ask : Is there any place with help - because I am a little bit lost in c# howto go for inserting data via web service

@gtrennert
Copy link

Because I tried to find help but there is always something missing - for example :
DataServiceResponse response = nav.SaveChanges();
'NAV' ne contient pas de définition pour 'SaveChanges' et aucune méthode d'extension accessible 'SaveChanges' acceptant un premier argument de type 'NAV' n'a été localisée (une directive using ou une référence d'assembly est-elle manquante ?)

@unchase
Copy link

unchase commented Sep 20, 2019

@gtrennert , could you create an issue in my repository: ask a question or report a bug?
It's easier for me to track it.

Check the issue after updating to Unchase OData Connected Service v1.3.0

On the last question: I can advise official documentation.

@unchase
Copy link

unchase commented Sep 24, 2019

Here a better screenshot of all the messages :
04 messages multiple

Fixed in Unchase OData Connected Service v1.3.2.

@ghost
Copy link

ghost commented Sep 24, 2021

Hello unchase - I am trying to use Unchase OData Connected Service 1.4.3 to connect to Accumatica OData feed but am getting this same invalid name issue - 'The value 'DB-StorageDetails' is invalid according to its datatype.... .... The Pattern constraint failed.
Any idea why this would be happening?
image

@nick-webbgh
Copy link

nick-webbgh commented Sep 24, 2021 via email

@ghost
Copy link

ghost commented Sep 27, 2021

Thanks for your reply, the dash in all the names does appear to be the issue but these are all the default objects in Accumatica OData feed and they work fine when consumed in other OData applications.
I'll have to see if our admin can have them renamed

@nick-webbgh
Copy link

Just out of interest, have you tried using the ordinary OData Connected Service instead of the Unchase one?

@ghost
Copy link

ghost commented Sep 28, 2021

Yes I did try it first but had issues with authentication which was easily solved using the Unchase one

@unchase
Copy link

unchase commented Sep 28, 2021

@zdrehs What kind of issues did you have exactly?

@nick-webbgh
Copy link

You can add authentication details into the custom headers (see link below):-

https://docs.microsoft.com/en-us/odata/connectedservice/accessing-endpoints-with-auth

@baguilar-work
Copy link

baguilar-work commented Sep 1, 2022

Ive been reading through the comments and from what I can tell my issue should not be an error: Adding Unchase OData Connected Service to the project failed: The attribute 'Precision' was not expected in the given context.

However, I cant seem to add it through VS 2022 using the newest version (1.5.1) of Unchase OData Service found through VS.

I had to upload the file im using as a .txt, as a heads up. Since it did not allow .xml

Any help would be greatful

Thanks!

imlsMetaData.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants