SlideShare a Scribd company logo
1 of 11
ODATA Batch Processing
Sending multiple operation
request using a single http
request
Sending Batch Request
 Batch request allows grouping multiple operation in a single http request
 Batch request is represented as a multipart MIME request with specific
headers and body part
Batch Request headers
 Batch request is submitted as a single POST request
 Batch request should point to the URI : <Service Root URI>/$batch
 Batch request should have a Content-Type header specifying a content type of
“multipart/mixed” and a boundary specification.
 Eg: Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-
8c71-56071383e77b
 The number here represent a guid
Batch Request body
 The body of the batch request should be made up of ordered sequence of
operations and/or changeset
 In the batch request body every operation and changeset is represented with
a specific mime-type
 A MIME part representing a query operation MUST include a Content-Type
header with value “application/http” and a Content-Transfer-
Encoding“ header with value ”binary”.
Sample Request body
 POST /service/$batch HTTP/1.1
Host: host
Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http
Content-Transfer-Encoding:binary
GET /service/Customers('ALFKI')
Host: host
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Length: ###
-changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Type: application/http
Content-Transfer-Encoding: binary
POST /service/Customers HTTP/1.1
Host: host
Content-Type: application/atom+xml;type=entry
Content-Length: ###
<AtomPub representation of a new Customer>
Sample Request body Cont.
 --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Type: application/http
Content-Transfer-Encoding:binary
PUT /service/Customers('ALFKI') HTTP/1.1
Host: host
Content-Type: application/json
If-Match: xxxxx
Content-Length: ###
<JSON representation of Customer ALFKI>
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621--
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http
Content-Transfer-Encoding:binary
GET service/Products HTTP/1.1
Host: host
--batch_36522ad7-fc75-4b56-8c71-56071383e77b--
Responding to a Batch Request
 A batch response body MUST match one-to-one with the corresponding batch
request body, such that the same multipart MIME message structure defined for
requests is used for responses
 The order of ChangeSets and query operations in a Batch request is significant as a
service MUST process the components of the Batch in the order recieved.
 All operations in a ChangeSet represent a single change unit so a service MUST
successfully process and apply all the requests in the ChangeSet or else apply none
of them.
 If the service receives a Batch request with an invalid set of headers it MUST
return a 4xx response code and perform no further processing of the request.
 If the set of request headers of a Batch request are valid (the Content-Type is set
to multipart/mixed, etc) the service MUST return a 2xx Success HTTP response
code
Sample Response
 HTTP/1.1 202 Accepted
DataServiceVersion: 1.0
Content-Length: ####
Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 200 Ok
Content-Type: application/atom+xml;type=entry
Content-Length: ###
<AtomPub representation of the Customer entity with EntityKey ALFKI>
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Length: ###
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Type: application/http
Content-Transfer-Encoding: binary
Sample Response
 HTTP/1.1 201 Created
Content-Type: application/atom+xml;type=entry
Location: http://host/service.svc/Customer('POIUY')
Content-Length: ###
<AtomPub representation of a new Customer entity>
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 204 No Content
Host: host
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621--
--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 404 Not Found
Content-Type: application/xml
Content-Length: ###
--batch_36522ad7-fc75-4b56-8c71-56071383e77b--
Thanks
Ashish Agrawal
meetashish@gmail.com

More Related Content

Viewers also liked (12)

Batch processing
Batch processingBatch processing
Batch processing
 
Batch processing
Batch processingBatch processing
Batch processing
 
#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing
 
Batch processing
Batch processingBatch processing
Batch processing
 
Batch Process Analytics
Batch Process Analytics Batch Process Analytics
Batch Process Analytics
 
Process design & steps
Process design & stepsProcess design & steps
Process design & steps
 
Process design
Process design  Process design
Process design
 
2 process-design
2 process-design2 process-design
2 process-design
 
Design process
Design processDesign process
Design process
 
Product and process design
Product and process designProduct and process design
Product and process design
 
Process design
Process designProcess design
Process design
 
Product design and process selection
Product design and process selectionProduct design and process selection
Product design and process selection
 

Similar to Odata batch processing

An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technologyvikram singh
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1vikram singh
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptVietAnhNguyen337355
 
Api wiki · git hub
Api wiki · git hubApi wiki · git hub
Api wiki · git hubFerry Irawan
 
Sun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideSun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideAlberto Romero Jiménez
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servletvikram singh
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteTushar B Kute
 
Java Servlets
Java ServletsJava Servlets
Java ServletsEmprovise
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01raviIITRoorkee
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )MohitJoshi154
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with ODataMahek Merchant
 

Similar to Odata batch processing (20)

An Introduction To Java Web Technology
An Introduction To Java Web TechnologyAn Introduction To Java Web Technology
An Introduction To Java Web Technology
 
Web Tech Java Servlet Update1
Web Tech   Java Servlet Update1Web Tech   Java Servlet Update1
Web Tech Java Servlet Update1
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.pptHTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
 
Api wiki · git hub
Api wiki · git hubApi wiki · git hub
Api wiki · git hub
 
Sun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguideSun certifiedwebcomponentdeveloperstudyguide
Sun certifiedwebcomponentdeveloperstudyguide
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 
Request dispatching in servlet
Request dispatching in servletRequest dispatching in servlet
Request dispatching in servlet
 
Basics Of Servlet
Basics Of ServletBasics Of Servlet
Basics Of Servlet
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
Web technology Unit-I Part D - message format
Web technology Unit-I  Part D - message formatWeb technology Unit-I  Part D - message format
Web technology Unit-I Part D - message format
 
Best Practices in Api Design
Best Practices in Api DesignBest Practices in Api Design
Best Practices in Api Design
 
HTTP
HTTPHTTP
HTTP
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )
 
W3 C11
W3 C11W3 C11
W3 C11
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 

More from Ashish Agrawal

Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.Ashish Agrawal
 
5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangalAshish Agrawal
 
7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...Ashish Agrawal
 
E paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescueE paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescueAshish Agrawal
 
Gcm and share point integration
Gcm and share point integrationGcm and share point integration
Gcm and share point integrationAshish Agrawal
 
Mobile engagement platform
Mobile engagement platformMobile engagement platform
Mobile engagement platformAshish Agrawal
 
Client certificate validation in windows 8
Client certificate validation in windows 8Client certificate validation in windows 8
Client certificate validation in windows 8Ashish Agrawal
 
Open office doc inside windows metro app
Open office doc inside windows metro appOpen office doc inside windows metro app
Open office doc inside windows metro appAshish Agrawal
 
Lync integration with metro app
Lync integration with metro appLync integration with metro app
Lync integration with metro appAshish Agrawal
 
E learning-for-all-devices
E learning-for-all-devicesE learning-for-all-devices
E learning-for-all-devicesAshish Agrawal
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 

More from Ashish Agrawal (14)

Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.Difference between product manager, program manager and project manager.
Difference between product manager, program manager and project manager.
 
5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal5 management &amp; leadership lessons from movie mission mangal
5 management &amp; leadership lessons from movie mission mangal
 
7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...7 factors determining deeper impact of ar based mobile application on user ex...
7 factors determining deeper impact of ar based mobile application on user ex...
 
E paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescueE paper-IOT based-medical-emergency-detection-and-rescue
E paper-IOT based-medical-emergency-detection-and-rescue
 
Gcm and share point integration
Gcm and share point integrationGcm and share point integration
Gcm and share point integration
 
Mobile engagement platform
Mobile engagement platformMobile engagement platform
Mobile engagement platform
 
Agile QA process
Agile QA processAgile QA process
Agile QA process
 
Side loading
Side loadingSide loading
Side loading
 
Client certificate validation in windows 8
Client certificate validation in windows 8Client certificate validation in windows 8
Client certificate validation in windows 8
 
Open office doc inside windows metro app
Open office doc inside windows metro appOpen office doc inside windows metro app
Open office doc inside windows metro app
 
Lync integration with metro app
Lync integration with metro appLync integration with metro app
Lync integration with metro app
 
E learning-for-all-devices
E learning-for-all-devicesE learning-for-all-devices
E learning-for-all-devices
 
Android overview
Android overviewAndroid overview
Android overview
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 

Recently uploaded

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Odata batch processing

  • 2. Sending multiple operation request using a single http request
  • 3. Sending Batch Request  Batch request allows grouping multiple operation in a single http request  Batch request is represented as a multipart MIME request with specific headers and body part
  • 4. Batch Request headers  Batch request is submitted as a single POST request  Batch request should point to the URI : <Service Root URI>/$batch  Batch request should have a Content-Type header specifying a content type of “multipart/mixed” and a boundary specification.  Eg: Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56- 8c71-56071383e77b  The number here represent a guid
  • 5. Batch Request body  The body of the batch request should be made up of ordered sequence of operations and/or changeset  In the batch request body every operation and changeset is represented with a specific mime-type  A MIME part representing a query operation MUST include a Content-Type header with value “application/http” and a Content-Transfer- Encoding“ header with value ”binary”.
  • 6. Sample Request body  POST /service/$batch HTTP/1.1 Host: host Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b --batch_36522ad7-fc75-4b56-8c71-56071383e77b Content-Type: application/http Content-Transfer-Encoding:binary GET /service/Customers('ALFKI') Host: host --batch_36522ad7-fc75-4b56-8c71-56071383e77b Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 Content-Length: ### -changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 Content-Type: application/http Content-Transfer-Encoding: binary POST /service/Customers HTTP/1.1 Host: host Content-Type: application/atom+xml;type=entry Content-Length: ### <AtomPub representation of a new Customer>
  • 7. Sample Request body Cont.  --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 Content-Type: application/http Content-Transfer-Encoding:binary PUT /service/Customers('ALFKI') HTTP/1.1 Host: host Content-Type: application/json If-Match: xxxxx Content-Length: ### <JSON representation of Customer ALFKI> --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621-- --batch_36522ad7-fc75-4b56-8c71-56071383e77b Content-Type: application/http Content-Transfer-Encoding:binary GET service/Products HTTP/1.1 Host: host --batch_36522ad7-fc75-4b56-8c71-56071383e77b--
  • 8. Responding to a Batch Request  A batch response body MUST match one-to-one with the corresponding batch request body, such that the same multipart MIME message structure defined for requests is used for responses  The order of ChangeSets and query operations in a Batch request is significant as a service MUST process the components of the Batch in the order recieved.  All operations in a ChangeSet represent a single change unit so a service MUST successfully process and apply all the requests in the ChangeSet or else apply none of them.  If the service receives a Batch request with an invalid set of headers it MUST return a 4xx response code and perform no further processing of the request.  If the set of request headers of a Batch request are valid (the Content-Type is set to multipart/mixed, etc) the service MUST return a 2xx Success HTTP response code
  • 9. Sample Response  HTTP/1.1 202 Accepted DataServiceVersion: 1.0 Content-Length: #### Content-Type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b --batch_36522ad7-fc75-4b56-8c71-56071383e77b Content-Type: application/http Content-Transfer-Encoding: binary HTTP/1.1 200 Ok Content-Type: application/atom+xml;type=entry Content-Length: ### <AtomPub representation of the Customer entity with EntityKey ALFKI> --batch_36522ad7-fc75-4b56-8c71-56071383e77b Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 Content-Length: ### --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 Content-Type: application/http Content-Transfer-Encoding: binary
  • 10. Sample Response  HTTP/1.1 201 Created Content-Type: application/atom+xml;type=entry Location: http://host/service.svc/Customer('POIUY') Content-Length: ### <AtomPub representation of a new Customer entity> --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 Content-Type: application/http Content-Transfer-Encoding: binary HTTP/1.1 204 No Content Host: host --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621-- --batch_36522ad7-fc75-4b56-8c71-56071383e77b Content-Type: application/http Content-Transfer-Encoding: binary HTTP/1.1 404 Not Found Content-Type: application/xml Content-Length: ### --batch_36522ad7-fc75-4b56-8c71-56071383e77b--