Introduction

The pull pattern is based on the need-to-know principle. In this pattern, the consumer knows the exact provider and asks for specific information which is made available only if and when possible. The sequence diagram attached depict a typical dialog scenario between the Consumer and the Provider using this message pattern.


Note: The encryption and the decryption of messages is used only in very specific cases and will be detailed in the section Encrypting and decrypting messages. The procedure to sign the message with a digital signature and the corresponding verification of the signature will be described in the specific page Signing messages and verifying the signature.



Messages

In the above typical dialog scenario between the Consumer and the Provider, an example of message interchange is as follow: the consumer send a PullRequest to ask specific information about a Vessel and the provider deliver that information in a PullResponse. The PullRequest message and the response in XML format are as bellow.


The sequence diagram

PullRequest

In the PullRequest. the all message is enclosed by the PullRequest tag. The received PullResponse corresponding to the example could have the Vessel Name and other attributes filled.


Business rules for the PullRequest

The message Pull Request is used in the Pull communication pattern to request information. This message extend the standard message structure, adding the following specific attributes (for the description of common message structure, see The standard Message structure common to all communication protocols). The specific attributes of the PullRequest are:



ElementRequiredValueDescription

PullType

Yes

One of the string values:

  • Request
  • Discover
  • Subscribe
  • Unsubscribe
  • GetSubscribers

In the specific case of a simple PullRequest we use "Request".

The Pull Type is to distinguish between the simple request and the subscription mechanism. It can also be use to unsubscribe to a flow.

ResponseTimeOut

No

Time in seconds. An integer value, as for example: 3600.

The request should be answered within this time limit. After this time, the response may not be considered by the requesting system.
RequestsNo

Example:

<Requests>
<ExpectedResponseTime>32
</ExpectedResponseTime>
</Requests>

See The ServiceCapability.

Service Capability required by the system provider. See The ServiceCapability.


DiscoveryProfilesNo

Not should be used, because the receiver (recipient) is knowed.

DiscoveryProfiles is only for unknown patterns, see The DiscoveryProfiles the way to profile a service.

PayloadSelectorNo

Supply a Selectors array refereed to the Payload data specified in the PullRequest.

To understand this element refers to The PayloadSelector for query by example.





PullRequest example

The Sender is a consumer, that make a request of data" and the Recipient is a Provider. Both are very well identified as services in the Cise Network.

Note the MessageID c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d.

Pull Request  Expand source
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:PullRequest xmlns:ns2="http://www.cise.eu/servicemodel/v1/authority/" xmlns:ns4="http://www.cise.eu/servicemodel/v1/message/" xmlns:ns3="http://www.cise.eu/servicemodel/v1/service/">
    <CorrelationID>c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d</CorrelationID>
    <CreationDateTime>2019-08-28T13:59:18.859Z</CreationDateTime>
    <MessageID>c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d</MessageID>
    <Priority>High</Priority>
    <RequiresAck>true</RequiresAck>
    <Sender>
        <ServiceID>cx.simlsa1-nodecx.vessel.pull.consumer</ServiceID>
        <ServiceOperation>Pull</ServiceOperation>
        <ServiceType>VesselService</ServiceType>
    </Sender>
    <Recipient>
        <ServiceID>cx.simlsa2-nodecx.vessel.pull.provider</ServiceID>
        <ServiceOperation>Pull</ServiceOperation>
        <ServiceType>VesselService</ServiceType>
    </Recipient>
    <Payload xsi:type="ns4:XmlEntityPayload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <InformationSecurityLevel>NonClassified</InformationSecurityLevel>
        <InformationSensitivity>Green</InformationSensitivity>
        <IsPersonalData>true</IsPersonalData>
        <Purpose>NonSpecified</Purpose>
        <Vessel xmlns:ns2="http://www.cise.eu/servicemodel/v1/service/" xmlns:ns3="http://www.cise.eu/servicemodel/v1/authority/">
        </Vessel>
    </Payload>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
            <Reference URI="">
                <Transforms>
                    <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
                        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.w3.org/2000/09/xmldsig#">
                            <xsl:strip-space elements="*"/>
                            <xsl:output indent="false" method="xml" omit-xml-declaration="yes"/>
                            <xsl:template match="*[not(self::s:Signature)]">
                                <xsl:element name="{local-name()}">
                                    <xsl:apply-templates select="*|text()"/>
                                </xsl:element>
                            </xsl:template>
                            <xsl:template match="s:Signature"/>
                        </xsl:stylesheet>
                    </Transform>
                    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <DigestValue>QcNx9DlqfY0dWl11QEL8EcluyQ8=</DigestValue>
            </Reference>
        </SignedInfo>
        <SignatureValue>obRJ9EHMr2E8NTddOP4i6oWOu0lMmb6xLt4K1Qu1j5iw2Nyd8PbPZxl9AJR7QNW5LYA6vZLm0xDF
jDZUviueFQbxzabNoksZ02zEHgOEuybAoBRd9PFNlePJBe4SBq7ageaUiGbV9IqyhyZgpvCbkEkp
jsDpS8MWOV8d4Flr8uvDetxiulSvXU0cwYneLqGU4wGAG3W8gggVfpxTVHhUemBzwjRwK6VwUGLI
GuN8jFBTqpE3kNjP7nFdFLi7IetbTYnZ5N4rjQP87KTCjTn8mIy9Nb1qMOjUbP8xZvDHO0RTm2RH
8W27HhsI1NZENwDr1wlDgO9Lr60wSqeUr+hkDQ==</SignatureValue>
        <KeyInfo>
            <X509Data>
                <X509SubjectName>C=cx, DC=eucise, O=nodecx, OU=Participants, CN=simlsa1-nodecx.nodecx.eucise.cx</X509SubjectName>
                <X509Certificate>MIIELjCCAxagAwIBAgIIf0MB71Z6/e0wDQYJKoZIhvcNAQELBQAwPTEdMBsGA1UEAwwUc2lnbmlu
Zy1jYS5ldWNpc2UuY3gxDzANBgNVBAoMBmV1Y2lzZTELMAkGA1UEBhMCY3gwHhcNMTkwODAyMTUz
ODM5WhcNMjkwNTMwMTY1ODEwWjB3MSgwJgYDVQQDDB9zaW1sc2ExLW5vZGVjeC5ub2RlY3guZXVj
aXNlLmN4MRUwEwYDVQQLDAxQYXJ0aWNpcGFudHMxDzANBgNVBAoMBm5vZGVjeDEWMBQGCgmSJomT
8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jyKko12OD6i
SUgaHbbq/0CkHBWOuoQxhmil2WJ5wU+0WWWfvhNNo7qUACtXu6XvhhHLiBD0855v</X509Certificate>
            </X509Data>
        </KeyInfo>
    </Signature>
    <PullType>Request</PullType>
    <ResponseTimeOut>1000</ResponseTimeOut>
</ns4:PullRequest>


Synchronous Acknowledgement received

Note that the CorrelationID (c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d) is referred to the PullRequest MessageID


Synchronous Acknowledgement received  Expand source
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:Acknowledgement xmlns:ns2="http://www.cise.eu/servicemodel/v1/authority/" xmlns:ns4="http://www.cise.eu/servicemodel/v1/message/" xmlns:ns3="http://www.cise.eu/servicemodel/v1/service/">
    <CorrelationID>c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d</CorrelationID>
    <CreationDateTime>2019-08-28T13:59:35.810Z</CreationDateTime>
    <MessageID>c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d_d26963a3-1dde-4fce-be7b-1133c6df910f</MessageID>
    <Priority>High</Priority>
    <RequiresAck>false</RequiresAck>
    <AckCode>Success</AckCode>
    <AckDetail>Message delivered</AckDetail>
</ns4:Acknowledgement>
Asynchronous Acknowledgement received

Note that the CorrelationID c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d is referred to the PullRequest message

Asynchronous Acknowledgement received  Expand source
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:Acknowledgement xmlns:ns2="http://www.cise.eu/servicemodel/v1/authority/" xmlns:ns4="http://www.cise.eu/servicemodel/v1/message/" xmlns:ns3="http://www.cise.eu/servicemodel/v1/service/">
    <CorrelationID>c7b7dea3-a2af-4ef9-b9e9-0d8e2e63f66d</CorrelationID>
    <CreationDateTime>2019-08-28T13:59:37.631Z</CreationDateTime>
    <MessageID>3e33a062-d557-4463-952f-f156d70e8387</MessageID>
    <Priority>Low</Priority>
    <RequiresAck>false</RequiresAck>
    <Sender>
        <ServiceID>cx.simlsa2-nodecx.vessel.pull.provider</ServiceID>
        <ServiceOperation>Acknowledgement</ServiceOperation>
        <Participant>
            <Id>eu.eucise.cx.simlsa2-nodecx</Id>
            <Name>Simulator LSA 2</Name>
            <Description>Second simulator LSA</Description>
            <ClassificationLevel>Unclassified</ClassificationLevel>
            <EndpointUrl>http://192.168.42.37:8380/sim-LSA/CISEMessageService</EndpointUrl>
            <EndpointType>SOAP</EndpointType>
            <ProvidedServicesIds>cx.simlsa2-nodecx.vessel.push.consumer</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa2-nodecx.persondocument.subscribe.consumer</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa2-nodecx.vessel.subscribe.consumer</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa2-nodecx.incident.subscribe.consumer</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa2-nodecx.locationdocument.subscribe.consumer</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa2-nodecx.vessel.pull.provider</ProvidedServicesIds>
            <Gateway>
                <Id>eu.eucise.cx.nodecx</Id>
            </Gateway>
            <Owner>JRC</Owner>
            <PointOfContact>
                <Name>Jesus</Name>
            </PointOfContact>
            <AreasOfInterest>BalticSea</AreasOfInterest>
            <AreasOfInterest>NorthSea</AreasOfInterest>
            <Communities>GeneralLawEnforcement</Communities>
            <Communities>MarineEnvironment</Communities>
            <Functions>Safety</Functions>
            <MemberState>CX</MemberState>
        </Participant>
    </Sender>
    <Recipient>
        <ServiceID>cx.simlsa1-nodecx.vessel.pull.consumer</ServiceID>
        <ServiceOperation>Acknowledgement</ServiceOperation>
        <Participant>
            <Id>eu.eucise.cx.simlsa1-nodecx</Id>
            <Name>Simulator LSA 1</Name>
            <Description>First simulator LSA</Description>
            <ClassificationLevel>Unclassified</ClassificationLevel>
            <EndpointUrl>http://192.168.42.37:8280/sim-LSA/CISEMessageService</EndpointUrl>
            <EndpointType>SOAP</EndpointType>
            <ProvidedServicesIds>cx.simlsa1-nodecx.vessel.push.provider</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa1-nodecx.vessel.pull.consumer</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa1-nodecx.persondocument.subscribe.provider</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa1-nodecx.vessel.subscribe.provider</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa1-nodecx.incident.subscribe.provider</ProvidedServicesIds>
            <ProvidedServicesIds>cx.simlsa1-nodecx.locationdocument.subscribe.provider</ProvidedServicesIds>
            <Gateway>
                <Id>eu.eucise.cx.nodecx</Id>
            </Gateway>
            <Owner>JRC</Owner>
            <PointOfContact>
                <Name>Jesus</Name>
                <Surname>Alvarado</Surname>
                <Address>10 Simon Cruz street, JRC, Italy</Address>
                <Telephone>+3984847722</Telephone>
                <Email>simon10.cruz@gmail.com</Email>
            </PointOfContact>
            <AreasOfInterest>BalticSea</AreasOfInterest>
            <AreasOfInterest>Mediterranean</AreasOfInterest>
            <Communities>Customs</Communities>
            <Communities>MaritimeSafetySecurity</Communities>
            <Functions>BorderMonitoring</Functions>
            <Functions>BorderOperation</Functions>
            <MemberState>CX</MemberState>
        </Participant>
    </Recipient>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:ns5="http://www.cise.eu/accesspoint/service/v1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
            <Reference URI="">
                <Transforms>
                    <Transform Algorithm="http://www.w3.org/TR/1999/REC-xslt-19991116">
                        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.w3.org/2000/09/xmldsig#">
                            <xsl:strip-space elements="*"/>
                            <xsl:output indent="false" method="xml" omit-xml-declaration="yes"/>
                            <xsl:template match="*[not(self::s:Signature)]">
                                <xsl:element name="{local-name()}">
                                    <xsl:apply-templates select="*|text()"/>
                                </xsl:element>
                            </xsl:template>
                            <xsl:template match="s:Signature"/>
                        </xsl:stylesheet>
                    </Transform>
                    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                <DigestValue>2rWk9Xr+ZJxMHzdKplbRbsxQu9E=</DigestValue>
            </Reference>
        </SignedInfo>
        <SignatureValue>VKlg2z3oVlTmKsgOodzA8JD+keo5E7Qw6J+xbHnlgTmX7a/WwSE+hOdYqyO9QOV/ElRtJbt9AEVY
HsbwndMnBqxGgXTvFWeD/Zl386Gqsb/t9+os/5jzqaEyFFFtgzbn6SKgZi3Ins9kEbrzBaFlgOx4
n4i0ymZrU45vFXtXJPRXNBVqTpr7MGLyNPhT9R2/rVb0MUC1vcphQUV8AwrWqT9LLTnMyU7iiS2n
spcKAJ0bdc5KpZqGgnGJlb7SVSYUdXoCHz9Sr1/4JA/WGDqX9h9Isb2kMvkXH7N1lEy9Z8PITLTF
9dB2Q2VIAAWRxqeEtitOQMSHqMHliVNQ3KMsNA==</SignatureValue>
        <KeyInfo>
            <X509Data>
                <X509SubjectName>C=cx, DC=eucise, O=nodecx, OU=HOSTS, CN=apache.nodecx.eucise.cx</X509SubjectName>
                <X509Certificate>MIIEFzCCAv+gAwIBAgIIPEea4OOlZW8wDQYJKoZIhvcNAQELBQAwPTEdMBsGA1UEAwwUc2lnbmlu
Zy1jYS5ldWNpc2UuY3gxDzANBgNVBAoMBmV1Y2lzZTELMAkGA1UEBhMCY3gwHhcNMTkwNTMxMTY1
ODI2WhcNMjkwNTMwMTY1MDM0WjBoMSAwHgYDVQQDDBdhcGFjaGUubm9kZWN4LmV1Y2lzZS5jeDEO
MAwGA1UECwwFSE9TVFMxDzANBgNVBAoMBm5vZGVjeDEWMBQGCgmSJomT8ixkARkWBmV1Y2lzZTEL
MAkG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InSlaf5u1I/gs
AyLlDhpigeQvncGryrt8Uk/V5n7f6t0S9w==</X509Certificate>
            </X509Data>
        </KeyInfo>
    </Signature>
    <AckCode>Success</AckCode>
    <AckDetail>Pull Request type REQUEST received</AckDetail>
</ns4:Acknowledgement>