BodyTemplate

Namespace: urn:mace:shibboleth:2.0:resolver
Schema: http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd

The <BodyTemplate> element provides the template from which a web service request body is built. This element is used when the POST method has to be used.

Note that several escapers are provided for use but you must perform the appropriate escaping because the escaping rules depend on the context of use.

Reference

Name

Type

Description

Name

Type

Description

MIMEType

String

Content type to attach to the request

charset

String

Character set parameter to qualify MIME type

As enumerated below, several variables are available in the template context. In practice, $resolutionContext.principal and various named dependent attributes (if any) tend to be most useful.

Name

Type

Description

Name

Type

Description

resolutionContext

AttributeResolutionContext

Commonly useful members include $resolutionContext.principal and $resolutionContext.attributeRecipientID

foo, bar, etc.

List<IdPAttributeValue>

For each IdPAttribute available from all the provided dependencies, the attributes' values are available as a collection under the attribute's name.

paramEscaper

com.google.common.escape.Escaper

For safe embedding of input data into a query parameter

fragmentEscaper

com.google.common.escape.Escaper

For safe embedding of input data into a URL fragment

pathEscaper

com.google.common.escape.Escaper

For safe embedding of input data into a URL path

xmlAttributeEscaper

com.google.common.escape.Escaper

For safe embedding of input data into an XML attribute

xmlContentEscaper

com.google.common.escape.Escaper

For safe embedding of input data in XML element content

httpClientSecurityParameters

HttpClientSecurityParameters

Rarely of interest but provides access to security parameters to be used during call

Example

The example demonstrates construction of a SOAP message.

1 2 3 4 5 6 7 8 9 10 11 <BodyTemplate MIMEType="text/xml"> <![CDATA[ <S:Envelope xmlns:S="http://www.w3.org/2001/12/soap-envelope"> <S:Body> <g:GetGroups xmlns:g="http://example.org/schema"> <g:Subject>$xmlContentEscaper.escape($employeeNumber.get(0))</g:Subject> </g:GetGroups> </S:Body> </S:Envelope> ]]> </BodyTemplate>