Etag value not valid on PUT request
Jorgecc
Member Posts: 2
Hello,
i am having problems trying to update records through NAV 2015 OData WS.
I am getting: "The etag value '28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;' specified in one of the request headers is not valid. Please make sure only one etag value is specified and is valid."
This is what i get if i do a GET:
GET http://*******:****/****/Odata/Company('***')/Socios('AD001')?$format=json
{
"odata.metadata": "http://*********.es:****/******/OData/$metadata#Socios/@Element",
"N_x00BA_": "AD001",
"Nombre": "JESUS",
"ETag": "28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;"
}
I am trying to update with this call:
PUT http://********.*****.es:****/*****/Odata/Company('****')/Socios('AD001') HTTP/1.1
Accept-Encoding: gzip,deflate
Authorization: Basic bGlmZXVzZXI6QXRhbWExYXRhbWEx
OData-MaxVersion: 4.0
OData-Version: 4.0
If-Match: 28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;
Content-Type: application/json
Accept: application/json
Content-Length: 107
Host: **********.*****.es:****
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
{
"N_x00BA_": "AD001",
"Nombre": "JESUS",
"ETag": "28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;"
}
Can i get some help?
Thx you very much.
i am having problems trying to update records through NAV 2015 OData WS.
I am getting: "The etag value '28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;' specified in one of the request headers is not valid. Please make sure only one etag value is specified and is valid."
This is what i get if i do a GET:
GET http://*******:****/****/Odata/Company('***')/Socios('AD001')?$format=json
{
"odata.metadata": "http://*********.es:****/******/OData/$metadata#Socios/@Element",
"N_x00BA_": "AD001",
"Nombre": "JESUS",
"ETag": "28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;"
}
I am trying to update with this call:
PUT http://********.*****.es:****/*****/Odata/Company('****')/Socios('AD001') HTTP/1.1
Accept-Encoding: gzip,deflate
Authorization: Basic bGlmZXVzZXI6QXRhbWExYXRhbWEx
OData-MaxVersion: 4.0
OData-Version: 4.0
If-Match: 28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;
Content-Type: application/json
Accept: application/json
Content-Length: 107
Host: **********.*****.es:****
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
{
"N_x00BA_": "AD001",
"Nombre": "JESUS",
"ETag": "28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;"
}
Can i get some help?
Thx you very much.
0
Answers
-
I found the solution:
The If-math header must have this format:
W / " ' EtagValue ' "
In my example: If-Match: W/"'28;X8MAAAJ7/0EARAAwADAAMQAAAAAA9;7238058930;'"
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 329 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