lab icon indicating copy to clipboard operation
lab copied to clipboard

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

Open bydamien opened this issue 7 years ago • 28 comments

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 avatar Jul 23 '18 19:07 bydamien

nobody wants to help me ?

bydamien avatar Jul 28 '18 17:07 bydamien

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

unchase avatar Feb 19 '19 21:02 unchase

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 ?

gtrennert avatar Aug 05 '19 19:08 gtrennert

@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 avatar Aug 05 '19 21:08 unchase

@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!

unchase avatar Aug 06 '19 18:08 unchase

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)

gtrennert avatar Aug 06 '19 19:08 gtrennert

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

unchase avatar Aug 06 '19 21:08 unchase

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

gtrennert avatar Aug 06 '19 21:08 gtrennert

@gtrennert, you're welcome.

unchase avatar Aug 06 '19 21:08 unchase

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?

nick-webbgh avatar Sep 11 '19 14:09 nick-webbgh

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

unchase avatar Sep 11 '19 21:09 unchase

Please see attached. Thanks in advance for your help.

From: [email protected] (Chebotov Nickolay) [email protected] Sent: 11 September 2019 22:34 To: OData/lab [email protected] Cc: Nick Webb [email protected]; Mention [email protected] 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.

nick-webbgh avatar Sep 12 '19 08:09 nick-webbgh

Hi. There is no attached files. Can you send again to [email protected]?

unchase avatar Sep 13 '19 19:09 unchase

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

From: [email protected] (Chebotov Nickolay) [email protected] Sent: 13 September 2019 20:57 To: OData/lab [email protected] Cc: Nick Webb [email protected]; Mention [email protected] 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.

nick-webbgh avatar Sep 16 '19 08:09 nick-webbgh

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 avatar Sep 20 '19 10:09 gtrennert

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

gtrennert avatar Sep 20 '19 11:09 gtrennert

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 avatar Sep 20 '19 11:09 gtrennert

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 ?)

gtrennert avatar Sep 20 '19 12:09 gtrennert

@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 avatar Sep 20 '19 18:09 unchase

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

Fixed in Unchase OData Connected Service v1.3.2.

unchase avatar Sep 24 '19 13:09 unchase

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

ghost avatar Sep 24 '21 02:09 ghost

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.

nick-webbgh avatar Sep 24 '21 08:09 nick-webbgh

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

ghost avatar Sep 27 '21 03:09 ghost

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

nick-webbgh avatar Sep 27 '21 14:09 nick-webbgh

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

ghost avatar Sep 28 '21 12:09 ghost

@zdrehs What kind of issues did you have exactly?

unchase avatar Sep 28 '21 12:09 unchase

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

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

nick-webbgh avatar Sep 28 '21 15:09 nick-webbgh

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

baguilar-work avatar Sep 01 '22 15:09 baguilar-work