Mode:

Compact lists

Showing:

Documentation
Used by
References
Source

Table of Contents

Group by:
Main stylesheet as4receipt.xsl
Documentation

Description

Created on: Feb 5, 2012

Author: pvde

This XSLT stylesheet is a non-normative part of the OASIS AS4 specification. It shows how AS4 receipt messages can be derived from AS4 user messages.

Parameters

messageid

The messageid to use on the AS4 receipt signal message

timestamp

The timestamp to set on the AS4 receipt signal message

Stylesheet version 1.0
[ top ]
Template S12:Envelope
Namespace No namespace
Match S12:Envelope
Mode #default
Import precedence 0
Source
<xsl:template match="S12:Envelope">
  <S12:Envelope>
    <xsl:apply-templates/>
  </S12:Envelope>
</xsl:template>
[ top ]
Template S12:Header
Namespace No namespace
Match S12:Header
Mode #default
Import precedence 0
Source
<xsl:template match="S12:Header">
  <S12:Header>
    <xsl:apply-templates select="eb3:Messaging"/>
  </S12:Header>
</xsl:template>
[ top ]
Template S12:Envelope[S12:Header//ds:Signature]/S12:Body
Documentation

Description

When generating a receipt for a signed message, the receipt will be signed as well. We generate an identifier for the empty SOAP Body of the AS4 receipt for the WS-Security module.
Namespace No namespace
Match S12:Envelope[S12:Header//ds:Signature]/S12:Body
Mode #default
Import precedence 0
Source
<xsl:template match="S12:Envelope[S12:Header//ds:Signature]/S12:Body">
  <S12:Body wsu:Id="{generate-id()}"/>
</xsl:template>
[ top ]
Template S12:Envelope[not(S12:Header//ds:Signature)]/S12:Body
Documentation

Description

The empty body of receipt signal receipt for an unsigned message does not need an identifier
Namespace No namespace
Match S12:Envelope[not(S12:Header//ds:Signature)]/S12:Body
Mode #default
Import precedence 0
Source
<xsl:template match="S12:Envelope[not(S12:Header//ds:Signature)]/S12:Body">
  <S12:Body/>
</xsl:template>
[ top ]
Template eb3:Messaging[ @S12:role='http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh']
Documentation

Description

There are two templates for eb3:Messaging element. This first template is for an AS4 user message that may have been exchanged over a multi-hop network. The receipt for such a message has WS-Addressing headers and a routing parameter based on the user message content.
Namespace No namespace
Match eb3:Messaging[ @S12:role='http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh']
Mode #default
Import precedence 0
Source
<xsl:template match="eb3:Messaging[         @S12:role='http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh']">
  <xsl:variable name="mpc">
    <xsl:choose>
      <xsl:when test="descendant::eb3:UserMessage[1]/@mpc">
        <xsl:value-of select="descendant::eb3:UserMessage[1]/@mpc"/>
      </xsl:when>
      <xsl:otherwise>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultMPC</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <wsa:To wsu:Id="{concat('_wsato_',generate-id())}" S12:role="http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh" S12:mustUnderstand="true">http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/icloud</wsa:To>
  <wsa:Action wsu:Id="{concat('_wsaaction_',generate-id())}">http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/oneWay.receipt</wsa:Action>
  <ebint:RoutingInput wsa:IsReferenceParameter="true" id="{concat('_ebroutinginput_',generate-id())}" S12:mustUnderstand="true" S12:role="http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh">
    <ebint:UserMessage mpc="{concat($mpc,'.receipt')}">
      <eb3:PartyInfo>
        <eb3:From>
          <xsl:copy-of select="descendant::eb3:UserMessage[1]//eb3:To/eb3:PartyId"/>
          <xsl:copy-of select="descendant::eb3:UserMessage[1]//eb3:To/eb3:Role"/>
        </eb3:From>
        <eb3:To>
          <xsl:copy-of select="descendant::eb3:UserMessage[1]//eb3:From/eb3:PartyId"/>
          <xsl:copy-of select="descendant::eb3:UserMessage[1]//eb3:From/eb3:Role"/>
        </eb3:To>
      </eb3:PartyInfo>
      <eb3:CollaborationInfo>
        <xsl:copy-of select="descendant::eb3:UserMessage[1]//eb3:Service"/>
        <eb3:Action>
          <xsl:value-of select="concat(descendant::eb3:UserMessage[1]//eb3:Action,'.receipt')"/>
        </eb3:Action>
        <xsl:copy-of select="descendant::eb3:UserMessage[1]//eb3:ConversationId"/>
      </eb3:CollaborationInfo>
    </ebint:UserMessage>
  </ebint:RoutingInput>
  <eb3:Messaging S12:mustUnderstand="true" id="{concat('_ebmessaging_',generate-id())}">
    <xsl:apply-templates select="descendant-or-self::eb3:UserMessage"/>
  </eb3:Messaging>
</xsl:template>
[ top ]
Template eb3:Messaging[not( @S12:role='http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh')]
Documentation

Description

This second template for the eb3:Messaging element covers AS4 point-to-point messages.
Namespace No namespace
Match eb3:Messaging[not( @S12:role='http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh')]
Mode #default
Import precedence 0
Source
<xsl:template match="eb3:Messaging[not(         @S12:role='http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh')]">
  <eb3:Messaging S12:mustUnderstand="true" id="{concat('_ebmessaging_',generate-id())}">
    <xsl:apply-templates select="descendant-or-self::eb3:UserMessage"/>
  </eb3:Messaging>
</xsl:template>
[ top ]
Template eb3:UserMessage
Documentation

Description

The AS4 receipt is generated based on eb3:UserMessage and ds:Signaturecontent.

  • A receipt for a signed AS4 message references the message parts using ds:References in the WS-Security header of that message
  • A receipt for an unsigned AS4 message references the message using the eb3:UserMessage structure of the AS4 message.
Namespace No namespace
Match eb3:UserMessage
Mode #default
References
Parameters
Import precedence 0
Source
<xsl:template match="eb3:UserMessage">
  <eb3:SignalMessage>
    <eb3:MessageInfo>
      <eb3:Timestamp>
        <xsl:value-of select="$timestamp"/>
      </eb3:Timestamp>
      <eb3:MessageId>
        <xsl:value-of select="$messageid"/>
      </eb3:MessageId>
      <eb3:RefToMessageId>
        <xsl:value-of select="descendant::eb3:MessageId"/>
      </eb3:RefToMessageId>
    </eb3:MessageInfo>
    <eb3:Receipt>
      <xsl:choose>
        <xsl:when test="/S12:Envelope/S12:Header/wsse:Security/ds:Signature">
          <ebbp:NonRepudiationInformation>
            <xsl:apply-templates select="//ds:Reference"/>
          </ebbp:NonRepudiationInformation>
        </xsl:when>
        <xsl:otherwise>
          <xsl:copy-of select="//eb3:UserMessage"/>
        </xsl:otherwise>
      </xsl:choose>
    </eb3:Receipt>
  </eb3:SignalMessage>
</xsl:template>
[ top ]
Template ds:Reference
Namespace No namespace
Match ds:Reference
Mode #default
Import precedence 0
Source
<xsl:template match="ds:Reference">
  <ebbp:MessagePartNRInformation>
    <xsl:copy-of select="current()"/>
  </ebbp:MessagePartNRInformation>
</xsl:template>
[ top ]
Parameter messageid
Namespace No namespace
Used by
Template
Source
<xsl:param name="messageid">someuniqueid@receiver.example.com</xsl:param>
[ top ]
Parameter timestamp
Namespace No namespace
Used by
Template
Source
<xsl:param name="timestamp">2012-02-05T19:43:11.735Z</xsl:param>
[ top ]
Output (default)
Namespace No namespace
Output properties
method indent
xml yes
Source
<xsl:output method="xml" indent="yes"/>
[ top ]