ODATA 'company' name issue (..."O'Reilly Corp"?)

ian_scho
Member Posts: 5
For a NAV 2016 CU48 instance we have published pages as web services, to be consumed by ODATA. We consider them stable.
However we have a company called for example "O'Reilly Corp" and the apostrophe is causing us some headache.
This is an issue that should be resolved by reading the ODATA specification documentation. For example, a GET can be either in NAV (Basic Auth):
Example1:
However, we also have a POST operation which isn't working for the first example, something like:
Example1:
Example2:
Here's the body, for completeness:
Obviously we can tell the developer consuming the web service the workaround is to use Example 2 URL, but I'd like to know if we are encoding incorrectly the 'Company' entity parameter.
However we have a company called for example "O'Reilly Corp" and the apostrophe is causing us some headache.
This is an issue that should be resolved by reading the ODATA specification documentation. For example, a GET can be either in NAV (Basic Auth):
Example1:
https://YourCorp.com/NAVInstance/OData/Company('O%27%27Reilly%20Corp')/BDHIncomingDocumentListWS?$format=json&tenant=116692Example2:
https://YourCorp.com/NAVInstance/OData/BDHIncomingDocumentListWS?$format=json&tenant=116692&company=O%27Reilly%20Corp
However, we also have a POST operation which isn't working for the first example, something like:
Example1:
https://YourCorp.com/NAVInstance/OData/Company('O%27%27Reilly%20Corp')/BDHIncomingDocumentActionsWS?tenant=116692
{ "odata.error"."message"."value": "The company \"O''Reilly Corp\" does not exist."}
Example2:
https://YourCorp.com/NAVInstance/OData/BDHIncomingDocumentActionsWS?tenant=116692&company=O%27Reilly%20Corp
Here's the body, for completeness:
Body: { "Action": "Create New Document", "Inc_Doc_Document_Type": "txt", "Name": "SalesXXX.txt", "FileContent": "PGFwcFNldHRpbmdzPgogIDxhZG..." }
Obviously we can tell the developer consuming the web service the workaround is to use Example 2 URL, but I'd like to know if we are encoding incorrectly the 'Company' entity parameter.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions