It's possible to publish an Odata webservice with json complex structure on Nav 2013 R2?

pereiranuno88
Member Posts: 6
I wanted to share a structure with elements, for example sales documents with lines.
I tried do a page with subpart element but with not sucess.
I only obtain headers.
{
"odata.metadata": "http://server:port/bd/OData/$metadata#Sales",
"value": [
{
"Document_Type": "Invoice",
"No": "VTFR012000001",
"Sell_to_Customer_No": "00596",
"ETag": "60;JAAAAACLAgAAAAJ7/1YAVABGAFIAMAAxADIAMAAwADAAMAAwADEAAAAAAA==10;21500026350;"
},
{
"Document_Type": "Invoice",
"No": "VTFR1092000021",
"Sell_to_Customer_No": "00003",
"ETag": "60;JAAAAACLAgAAAAJ7/1YAVABGAFIAMQAwADkAMgAwADAAMAAwADIAMQAAAAAA10;21496498140;"
},
I tried do a page with subpart element but with not sucess.
I only obtain headers.
{
"odata.metadata": "http://server:port/bd/OData/$metadata#Sales",
"value": [
{
"Document_Type": "Invoice",
"No": "VTFR012000001",
"Sell_to_Customer_No": "00596",
"ETag": "60;JAAAAACLAgAAAAJ7/1YAVABGAFIAMAAxADIAMAAwADAAMAAwADEAAAAAAA==10;21500026350;"
},
{
"Document_Type": "Invoice",
"No": "VTFR1092000021",
"Sell_to_Customer_No": "00003",
"ETag": "60;JAAAAACLAgAAAAJ7/1YAVABGAFIAMQAwADkAMgAwADAAMAAwADIAMQAAAAAA10;21496498140;"
},
0
Answers
-
Hello @pereiranuno88,
That's the way the ODATA works, but you must get too a reference to the lines in the page that you need to call again to obtain these lines
Something like this with the Page 42 from Postman:
Maybe the best thing is create a Query with the tables that you need and publish it like a web service.
Regards
0 -
Hello @pereiranuno88,
That's the way the ODATA works, but you must get too a reference to the lines in the page that you need to call again to obtain these lines
Something like this with the Page 42 from Postman:
Maybe the best thing is create a Query with the tables that you need and publish it like a web service.
Regards
Hello @ftornero ,
Thank you very much for the answer. I will see this with more detail. For a WS to create SalesOrder On Nav 2013 R2 you recomend use Odata or SOAP?
Regards0 -
Hello @pereiranuno88,
I am using SOAP and a XMLPort in a similar scenario, but I am writing first the Input Order in two new tables (header and lines) and later on from these tables I create the Sales Order.
Regards1 -
Hello @pereiranuno88,
I am using SOAP and a XMLPort in a similar scenario, but I am writing first the Input Order in two new tables (header and lines) and later on from these tables I create the Sales Order.
Regards
Thank you @ftornero .
0 -
Hello @pereiranuno88,
That's the way the ODATA works, but you must get too a reference to the lines in the page that you need to call again to obtain these lines
Something like this with the Page 42 from Postman:
Maybe the best thing is create a Query with the tables that you need and publish it like a web service.
RegardsHello @pereiranuno88,
That's the way the ODATA works, but you must get too a reference to the lines in the page that you need to call again to obtain these lines
Something like this with the Page 42 from Postman:
Maybe the best thing is create a Query with the tables that you need and publish it like a web service.
Regards
Hello @ftornero
I trie using the referente to get the lines like you said, but i obtain the above error.
0 -
Hello @pereiranuno88,
I did the test with Powershell and it works, could you post the code you are using ?
Regards
0 -
Hello @ftornero ,
I already did, in another environment. I must have some cumulative update for update.
Thank you very much!
Kind regards0
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