Skip to content
Louis-Axel Ambroise edited this page Jun 25, 2020 · 4 revisions

SOAP Query interface

FasTnT EPCIS repository implements a full query interface as defined in the GS1 EPCIS 1.2 specification. The available queries are:

  • GetStandardVeresion
  • GetVendorVersion
  • GetQueryNames
  • Poll
  • Subscribe
  • Unsubscribe
  • GetSubscriptionIDs

FasTnT EPCIS repository allows to query its data using SOAP, as descrived in the EPCIS 1.2 specification.

The endpoint for the query interface is /v1_2/Query.svc. All the different queries are made on the EPCIS 1.2 repository using SOAP binding and content-type application/xml or text/xml.

GetStandardVersion

This query returns the currently implemented version of GS1's EPCIS standard. The returned value is 1.2.

Query:

$curl -X POST http://localhost:54805/v1_2/Query.svc -d
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:epcglobal:epcis-query:xsd:1">
  <soapenv:Body>
    <urn:GetStandardVersion />
  </soapenv:Body>
</soapenv:Envelope>

Response:

HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1">
    <soapenv:Body>
        <epcisq:GetStandardVersionResult>1.2</epcisq:GetStandardVersionResult>
    </soapenv:Body>
</soapenv:Envelope>

GetVendorVersion

This query returns the current version of FasTnT EPCIS repository.

Query:

$curl -X POST http://localhost:54805/v1_2/Query.svc -d
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:epcglobal:epcis-query:xsd:1">
  <soapenv:Body>
    <urn:GetVendorVersion />
  </soapenv:Body>
</soapenv:Envelope>

Response:

HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1">
    <soapenv:Body>
        <epcisq:GetVendorVersionResult>0.6.0</epcisq:GetVendorVersionResult>
    </soapenv:Body>
</soapenv:Envelope>

GetQueryNames

This query returns the implemented queries allowed by this EPCIS repository implementation.

Query:

$curl -X POST http://localhost:54805/v1_2/Query.svc -d
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:epcglobal:epcis-query:xsd:1">
  <soapenv:Body>
    <urn:GetQueryNames />
  </soapenv:Body>
</soapenv:Envelope>

Response:

HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1">
    <soapenv:Body>
        <epcisq:GetQueryNamesResult>
            <string>SimpleEventQuery</string>
            <string>SimpleMasterDataQuery</string>
        </epcisq:GetQueryNamesResult>
    </soapenv:Body>
</soapenv:Envelope>

Poll

There are 2 available queries by default:

  • SimpleEventQuery
  • SimpleMasterDataQuery

Each of these queries have a set of accepted parameters that you can find in the specification document, and you can find examples of most of them in the Postman example collection.

Subscribe

Create a new subscription on the EPCIS server. See the subscriptions page for more details.

Unsubscribe

Remove an existing subscription from the EPCIS server. See the subscriptions page for more details.

List all subscription IDs

This query returns the existing subscription IDs registered in the EPCIS repository.

Query:

$curl -X POST http://localhost:54805/v1_2/Query.svc -d
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:epcglobal:epcis-query:xsd:1">
  <soapenv:Body>
  	<urn:GetSubscriptionIDs>
    	<queryName>SimpleEventQuery</queryName>
    </urn:GetSubscriptionIDs>
  </soapenv:Body>
</soapenv:Envelope>

Response:

HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1">
    <soapenv:Body>
        <epcisq:GetSubscriptionIDsResult />
    </soapenv:Body>
</soapenv:Envelope>

Generalities

The queries are executed synchronously against the PostgreSQL database, and the results are returned in the same HTTP connection the query was made.

The specification allows the implementation of AS2 protocol for query interface, that allows to perform asynchronous queries, but this is not implemented yet in FasTnT EPCIS repository.