Glossary Item Box

Government Gateway 2.2.0 (MR-01) ISV Developer Help (Doc Version 06/03/08) | Send comments on this topic.

# Calling GsoDelegateRights using a UsernameToken

#### Example Request

Below is the SOAP Envelope for a client calling GsoDelegteRights using a UsernameToken.

Note: The actual XML on the wire that is being sent in GsoDelegteRights has been escaped as it is treated like a string; i.e. "<" becomes "&lt;" and ">" becomes "&gt;".

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
      xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <soap:Header>
        <wsa:Action>http://www.gateway.gov.uk/soap/2007/02/delegatedrights/GsoDelegateRights</wsa:Action>
        <wsa:MessageID>uuid:ec015854-2274-4a9b-a0d5-261e09dc9083</wsa:MessageID>
        <wsa:ReplyTo>
        <wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
        </wsa:ReplyTo>
        <wsa:To>http://www.gateway.gov.uk/soap/2007/02/delegatedrights</wsa:To>
        <wsse:Security soap:mustUnderstand="1">
        <wsu:Timestamp wsu:Id="Timestamp-eff1bb7a-eb63-40fc-aa7f-941077b26570">
          <wsu:Created>2007-02-05T10:46:45Z</wsu:Created>
          <wsu:Expires>2007-02-05T10:51:45Z</wsu:Expires>
        </wsu:Timestamp>
        <wsse:UsernameToken
          xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
          wsu:Id="SecurityToken-00bb7601-e6a2-4f90-bcab-5796d56a66d1">
          <wsse:Username>D37J9U1B3P5X</wsse:Username>
          <wsse:Password
            Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
            KT9J/b33F0/RSPKeYeISXuL5Gus=
          </wsse:Password>
          <wsse:Nonce>mBF+gyiB4uvRae4WnFJkuA==</wsse:Nonce>
          <wsu:Created>2007-02-05T10:46:45Z</wsu:Created>
        </wsse:UsernameToken>
        </wsse:Security>
      </soap:Header>
      <soap:Body>
        <GsoDelegateRights xmlns="http://www.gateway.gov.uk/soap/2007/02/delegatedrights">
          <inputXml>
            &lt;?xml version="1.0" encoding="utf-8"?&gt;
            &lt;GsoDelegateRightsXmlInput xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="urn:GSO-System-Services:external:2.10:GsoDelegateRightsXmlInput"&gt;
              &lt;RequestID&gt;0246DF5AC0984ADEAD6807F7A3797BA7&lt;/RequestID&gt;
              &lt;SecondsToExpiry&gt;600&lt;/SecondsToExpiry&gt;
              &lt;UserDetails&gt;
                &lt;Name&gt;Agent User&lt;/Name&gt;
                &lt;SessionIdentifier&gt;AgentUserPayrollNo&lt;/SessionIdentifier&gt;
                &lt;Email&gt;agent.user@agentorg.co.uk&lt;/Email&gt;
                &lt;CredentialRole&gt;DelegatedUser&lt;/CredentialRole&gt;
              &lt;/UserDetails&gt;
              &lt;DirectEnrolments&gt;
                &lt;DirectEnrolment&gt;
                  &lt;ServiceName&gt;MOSW11AGENT&lt;/ServiceName&gt;
                  &lt;Identifiers&gt;
                     &lt;Identifier IdentifierType="MOSW11AGENTID"&gt;aa11aa&lt;/Identifier&gt;
                   &lt;/Identifiers&gt;
                &lt;/DirectEnrolment&gt;
              &lt;/DirectEnrolments&gt;
              &lt;ClientAllocations&gt;
                &lt;ClientAllocation&gt;
                  &lt;ServiceName&gt;MOSW11&lt;/ServiceName&gt;
                  &lt;Identifiers&gt;
                    &lt;Identifier IdentifierType="MOSW11ID"&gt;bb11bb&lt;/Identifier&gt;
                  &lt;/Identifiers&gt;
                &lt;/ClientAllocation&gt;
                &lt;ClientAllocation&gt;
                  &lt;ServiceName&gt;MOSW11&lt;/ServiceName&gt;
                  &lt;Identifiers&gt;
                    &lt;Identifier IdentifierType="MOSW11ID"&gt;cc11cc&lt;/Identifier&gt;
                  &lt;/Identifiers&gt;
                &lt;/ClientAllocation&gt;
                &lt;ClientAllocation&gt;
                  &lt;ServiceName&gt;MOSW11&lt;/ServiceName&gt;
                  &lt;Identifiers&gt;
                    &lt;Identifier IdentifierType="MOSW11ID"&gt;dd11dd&lt;/Identifier&gt;
                  &lt;/Identifiers&gt;
                &lt;/ClientAllocation&gt;
              &lt;/ClientAllocations&gt;
            &lt;/GsoDelegateRightsXmlInput&gt
          </inputXml>
        </GsoDelegateRights>
      </soap:Body>
    </soap:Envelope>

Notes:

> 1. <wsa:Action> ... </wsa:Action>

> The URL (or urn) for the method.

> 2. <wsa:To>... </wsa:To>

> This is the actor for the delegatedrights Interface.

> 3. <GsoDelegateRights xmlns="...">

> This has the same value as (2.).

> 4. Identifiers need to be unique across the message (this implementation is based on GUIDs, e.g. 82c56821-1970-49fa-8edd-6da6fa327fd3); including a label as part of an identifier aids readability.

#### Example Response

Below is the response from the GsoDelegateRights call; the message is the same independent of whether the method request used a UsernameToken or an X509SecurityToken.

Note: The actual XML on the wire that is being sent back from GsoDelegateRights, has been escaped as it is treated like a string; i.e. "<" becomes "&lt;" and ">" becomes "&gt;".

    <soap:Envelope
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <soap:Header>
        <wsa:Action>http://www.gateway.gov.uk/soap/2007/02/delegatedrights/GsoDelegateRightsResponse</wsa:Action>
        <wsa:MessageID>uuid:cdb4143a-dd09-449e-991f-f01dd28137fc</wsa:MessageID>
        <wsa:RelatesTo>uuid:ec015854-2274-4a9b-a0d5-261e09dc9083</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
        <wsse:Security>
        <wsu:Timestamp wsu:Id="Timestamp-6e696ab7-a42a-49fe-a3c1-11cadcf9574d">
          <wsu:Created>2007-02-05T10:46:48Z</wsu:Created>
          <wsu:Expires>2007-02-05T10:51:48Z</wsu:Expires>
        </wsu:Timestamp>
        </wsse:Security>
      </soap:Header>
      <soap:Body>
        <GsoDelegateRightsResponse xmlns="http://www.gateway.gov.uk/soap/2007/02/delegatedrights">
          <outputXml>
            &lt;?xml version="1.0" encoding="utf-8"?&gt;
            &lt;GsoDelegateRightsXmlOutput xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            RequestID="261D16719D3040807A8993BD05289A6C"
            xmlns="urn:GSO-System-Services:external:2.10:GsoDelegateRightsXmlOutput"&gt;
              &lt;GatewayOneTimeToken&gt;dnsfweyt4876irehgy4248fk3&lt;/GatewayOneTimeToken&gt;
              &lt;InvalidClientAllocations&gt;
                &lt;ClientAllocation&gt;
                  &lt;ServiceName&gt;MOSW11&lt;/ServiceName&gt;
                  &lt;Identifiers&gt;
                    &lt;Identifier IdentifierType="MOSW11ID"&gt;dd11dd&lt;/Identifier&gt;
                  &lt;/Identifiers&gt;
                &lt;/ClientAllocation&gt;
              &lt;/InvalidClientAllocations&gt;
            &lt;/GsoDelegateRightsXmlOutput&gt;
          </outputXml>
        </GsoDelegateRightsResponse>
      </soap:Body>
    </soap:Envelope>

Notes:

> 1. <wsa:Action> ... </wsa:Action>

> This is the same as the namespace in the request GsoDelegateRights element.

> 2. Identifiers need to be unique across the message (this implementation is based on GUIDs, e.g. 82c56821-1970-49fa-8edd-6da6fa327fd3); including a label as part of an identifier aids readability.

© Crown Copyright 2008. All rights reserved