Skip to content

6. Examples for Capture Service (XML)

Jaewook Byun edited this page Aug 22, 2023 · 1 revision

HTTP.OPTIONS /

  • 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

HTTP.POST /capture

  • 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>

HTTP.GET /capture/:captureID (note: captureID is a path variable)


  • 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>

HTTP.POST /events

  • 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

HTTP.GET /capture

  • 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

<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>

HTTP.DELETE /nextPageToken/:pageID


  • 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>