OData / lab

This repository is for exploring new ideas and developing early prototypes of various OData stacks.
Other
48 stars 59 forks source link

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

Open bydamien opened 6 years ago

bydamien commented 6 years ago

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

nobody wants to help me ?

unchase commented 5 years ago

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

gtrennert commented 5 years ago

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

@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 commented 5 years ago

@gtrennert. OData library does not support a naming in form of "_Balance_LCY_Payment_in_progressLCY", 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 commented 5 years ago

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

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

gtrennert commented 5 years ago

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

unchase commented 5 years ago

@gtrennert, you're welcome.

nick-webbgh commented 5 years ago

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

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

nick-webbgh commented 5 years ago

Please see attached. Thanks in advance for your help.

From: notifications@github.com (Chebotov Nickolay) notifications@github.com Sent: 11 September 2019 22:34 To: OData/lab lab@noreply.github.com Cc: Nick Webb Nick.Webb@o-net.co.uk; Mention mention@noreply.github.com Subject: Re: [OData/lab] Error:Adding OData Connected Service to the project failed: The 'Name' attribute is invalid (#89)

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OData/lab/issues/89?email_source=notifications&email_token=AMXXQM3JJVQHNPA7USBPWQ3QJFP4LA5CNFSM4FLOKX52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6P67II#issuecomment-530575265, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMXXQM2Z4NQ25AFZWBXLXETQJFP4LANCNFSM4FLOKX5Q.

unchase commented 5 years ago

Hi. There is no attached files. Can you send again to spiritkola@hotmail.com?

nick-webbgh commented 5 years ago

I did attach the file last time. Maybe it got blocked. I’ve zipped it this time.

From: notifications@github.com (Chebotov Nickolay) notifications@github.com Sent: 13 September 2019 20:57 To: OData/lab lab@noreply.github.com Cc: Nick Webb Nick.Webb@o-net.co.uk; Mention mention@noreply.github.com Subject: Re: [OData/lab] Error:Adding OData Connected Service to the project failed: The 'Name' attribute is invalid (#89)

There is no attached files.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OData/lab/issues/89?email_source=notifications&email_token=AMXXQM4Q2REUIISDW2435VLQJPWADA5CNFSM4FLOKX52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6WBHTA#issuecomment-531370956, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMXXQMZ7S2UJNNWWCCJU5WTQJPWADANCNFSM4FLOKX5Q.

gtrennert commented 5 years ago

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

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

gtrennert commented 5 years ago

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

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

@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 commented 5 years ago

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

Fixed in Unchase OData Connected Service v1.3.2.

ghost commented 3 years ago

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

The first thing I would try is to remove the dash from DB-StorageDetails?

From: @. (zdrehs) @.> Sent: 24 September 2021 03:05 To: OData/lab @.> Cc: Nick Webb @.>; Mention @.***> Subject: Re: [OData/lab] Error:Adding OData Connected Service to the project failed: The 'Name' attribute is invalid (#89)

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]https://user-images.githubusercontent.com/91299198/134607195-b6a65a43-fdf9-4095-b1cf-a9f06fe1d366.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OData/lab/issues/89#issuecomment-926287841, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMXXQMZI5YDCXXKM7CDMA4TUDPMC5ANCNFSM4FLOKX5Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ghost commented 3 years ago

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

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

ghost commented 3 years ago

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

unchase commented 3 years ago

@zdrehs What kind of issues did you have exactly?

nick-webbgh commented 3 years ago

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

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