-
Notifications
You must be signed in to change notification settings - Fork 54
6. Examples for Capture Service (XML)
Jaewook Byun edited this page Aug 22, 2023
·
1 revision
- Description: check options at /
- Request URL: http://localhost:8080/epcis (example)
- ( works similarly for /capture , /capture/:captureID , /events )
- Response Headers (example)
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Key: GS1-Vendor-Version, Value: org.oliot.epcis-2.2.0
- Key: GS1-CBV-Version, Value: 2.0.0
- Key: GS1-EPC-Format, Value: Always_EPC_URN
- Key: GS1-CBV-XML-Format, Value: Always_URN
- Description: capture an EPCIS document in an XML format to an EPCIS server
- Request URL: http://localhost:8080/epcis/capture (example)
- Request Headers
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Key: GS1-CBV-Version, Value: 2.0.0
- Key: GS1-EPCIS-Capture-Error-Behaviour, Value: rollback
- Request Body ( Type: application/xml )
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE project>
<epcis:EPCISDocument xmlns:epcis="urn:epcglobal:epcis:xsd:2" schemaVersion="2.0"
creationDate="2022-11-11T14:59:02.099+09:00">
<EPCISBody>
<EventList>
<ObjectEvent>
<eventTime>2022-11-11T14:59:02.099+09:00</eventTime>
<eventTimeZoneOffset>+09:00</eventTimeZoneOffset>
<epcList>
<epc>urn:epc:id:sgtin:0614141.107346.2018</epc>
</epcList>
<action>ADD</action>
</ObjectEvent>
<ObjectEvent>
<eventTime>2022-11-11T14:59:02.099+09:00</eventTime>
<eventTimeZoneOffset>+09:00</eventTimeZoneOffset>
<epcList>
<epc>urn:epc:id:sgtin:0614141.107346.2018</epc>
</epcList>
<action>ADD</action>
</ObjectEvent>
</EventList>
</EPCISBody>
</epcis:EPCISDocument>
- Response Status: 202 Accepted (Example)
- Response Headers (Example)
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Key: GS1-CBV-Version, Value: 2.0.0
- Key: Location, Value: http://localhost:8080/epcis/capture/64733f1a060d032a3e9d678e
- Description: track a given capture job
- Request URL: http://localhost:8080/epcis/capture/64733f1a060d032a3e9d678e (example)
- Request Headers
- Key: GS1-EPCIS-Min, Value: 1.0.1
- Key: GS1-EPCIS-Max, Value: 2.0.0
- Response Status: 200 OK (Example)
- Response Headers (Example)
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Response Body ( Type: application/xml )
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ns2:epcisCaptureJobType xmlns:ns2="urn:epcglobal:epcis:xsd:2" xmlns:ns3="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" captureID="64b542a29ed27c0af00cfe36" running="false" success="true">
<captureErrorBehaviour>rollback</captureErrorBehaviour>
<createdAt>2023-07-17T13:31:14.313Z</createdAt>
<finishedAt>2023-07-17T13:31:14.350Z</finishedAt>
<errors>
<error/>
</errors>
</ns2:epcisCaptureJobType>
- Description: capture a single EPCIS event in an XML format, synchronously
- Request URL: http://localhost:8080/epcis/events (example)
- Request Headers
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Key: GS1-CBV-Version, Value: 2.0.0
- Key: type, Value: ObjectEvent (note: optional, works well even if omitted)
- Request Body ( Type: application/xml )
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE project>
<epcis:ObjectEvent xmlns:epcis="urn:epcglobal:epcis:xsd:2" schemaVersion="2.0" creationDate="2022-11-11T14:59:02.099+09:00">
<eventTime>2022-11-11T14:59:02.099+09:00</eventTime>
<eventTimeZoneOffset>+09:00</eventTimeZoneOffset>
<epcList>
<epc>urn:epc:id:sgtin:0614141.107346.2018</epc>
</epcList>
<action>ADD</action>
</epcis:ObjectEvent>
- Response Status: 201 Created (Example)
- Response Headers (Example)
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Key: GS1-CBV-Version, Value: 2.0.0
- Key: Location, Value: /events/ni%3A%2F%2F%2Fsha-256%3Bd66a6b7e2a4e447d250fb704be73fa6583612f62db1c42d7320aa4a12d895304%3Fver%3DCBV2.0
- Description: track all the capture jobs
- Request URL: http://localhost:8080/epcis/capture?PerPage=3 (example)
- URL parameters
- Key: PerPage, Value: 3
- Request Headers
- Key: GS1-EPCIS-Min, Value: 1.0.1
- Key: GS1-EPCIS-Max, Value: 2.0.0
- Response Status: 200 OK (Example)
- Response Headers (Example)
- Key: GS1-EPCIS-Version, Value: 2.0.0
- Key: Link, Value: http://192.168.0.177:8080/epcis/capture?PerPage=3&NextPageToken=981b426f-30ef-4103-b05c-85ed9b46f77c (if any remaining pages exist)
- Key: GS1-Next-Page-Token-Expires, Value: 2023-07-17T22:45:09Z
- Response Body ( Type: application/xml )
<epcisCaptureJobList>
<ns2:epcisCaptureJobType xmlns:ns2="urn:epcglobal:epcis:xsd:2" xmlns:ns3="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" captureID="64b542a29ed27c0af00cfe36" running="false" success="true">
<captureErrorBehaviour>rollback</captureErrorBehaviour>
<createdAt>2023-07-17T13:31:14.313Z</createdAt>
<finishedAt>2023-07-17T13:31:14.350Z</finishedAt>
<errors>
<error/>
</errors>
</ns2:epcisCaptureJobType>
</epcisCaptureJobList>
- Description: delete a non-expired page
- Request URL: http://localhost:8080/epcis/a456362d-99f4-4ceb-a517-db48bd198c0a (example)
- Response Status: 204 No Content (Example), or
- Response Status: 404 Not Found (Example)
- Response Body ( Type: application/xml )
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns2:epcisException xmlns:ns2="urn:epcglobal:epcis:xsd:2">
<reason>There is no page with token: dcf55df1-8acf-4e8b-be7d-203b4b236144</reason>
</ns2:epcisException>
</soapenv:Body>
</soapenv:Envelope>