Glossary Item Box

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

# Example of Using a GatewayToken to Get a User's Details

Once a GatewayToken has been obtained, the methods on the SOAP Portal interface (that require a GatewayToken) and the methods on the SOAP Public interface can be called.

#### Example GsoGetUserDetails Request

Below is the SOAP Envelope for a user calling GsoGetUserDetails. Security element in the SOAP Header includes a GatewayToken.

The SOAP message uses standard WS-Security, WS-Addressing and WS-Policy specification elements.

Note: The actual XML on the wire that is being sent to GsoGetUserDetails 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/public/GsoGetUserDetails</wsa:Action>
        <wsa:MessageID>uuid:dc728af7-fecb-49af-a0f3-8055f85526d0</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/public</wsa:To>
        <wsse:Security soap:mustUnderstand="1">
          <wsu:Timestamp wsu:Id="Timestamp-6a3e865d-36f9-4b80-8e83-474f0adfc485">
            <wsu:Created>2007-02-23T12:25:33Z</wsu:Created>
            <wsu:Expires>2007-02-23T12:30:33Z</wsu:Expires>
          </wsu:Timestamp>
          <gateway:GatewayToken xmlns:gateway="urn:GSO-System-Services:external:1.65:gatewaytoken" gateway:TokenId="SecurityToken-34cd40fa-3dc5-4084-a992-b3415e079d28">
            <gateway:Created>2007-02-23T12:25:13Z</gateway:Created>
            <gateway:Expires>2007-02-23T16:25:13Z</gateway:Expires>
            <gateway:Usage>Standard</gateway:Usage>
            <gateway:Opaque>CiGIJQ5/VNJVbTW5dr38R4jxqq3D1Qzvi3zrSGyXoOJiMx3pxozFBLF23dGwoMa1Bymjgq8ua4g2sUvFOTM0/cUenTMqdKC7O7JauS6oG8U5POcxjUFx/g==</gateway:Opaque>
          </gateway:GatewayToken>
        </wsse:Security>
      </soap:Header>
      <soap:Body>
        <GsoGetUserDetails xmlns="http://www.gateway.gov.uk/soap/2007/02/public">
          <inputXml>
            &lt;?xml version="1.0" encoding="utf-8"?&gt;
            &lt;GsoGetUserDetailsXmlInput xmlns="urn:GSO-System-Services:external:1.65:GsoGetUserDetailsXmlInput" /&gt;
          </inputXml>
        </GsoGetUserDetailsXmlInput>
      </soap:Body>
    </soap:Envelope>

Notes:

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

> The URL (or urn) for the method. In this example the Public endpoint is referenced (rather than the Portal endpoint) because the GsoGetUserDetails is being used from an ISV application. The value is either:

> - http://www.gateway.gov.uk/soap/2007/02/public/GsoGetUserDetails if the WS-* compliant endpoint set is used. Portals/applications should (be migrated to) use these endpoints.
> - urn:GSO-System-Services:external:1.65:PublicInterface/GsoGetUserDetails if the non-WS-* compliant (legacy) endpoint set is used.

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

> This is the actor for the Public Interface. The options are:

> - http://www.gateway.gov.uk/soap/2007/02/public if the WS-* compliant Public Interface endpoint is used. Portals/applications should (be migrated to) use these endpoints.
> - urn:GSO-System-Services:external:1.65:PublicInterface if the non-WS-* compliant (legacy) Public endpoint is to be used

> 3. <GsoGetUserDetails 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 GsoGetUserDetails Response

Below is the response from the GsoGetUserDetails call.

The SOAP message uses standard WS-Security, WS-Addressing and WS-Policy specification elements.

Note: The actual XML on the wire that is being sent back from GsoGetUserDetails, has been escaped as it is treated like a string.

    <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/public/GsoGetUserDetailsResponse</wsa:Action>
        <wsa:MessageID>uuid:8b922c9f-094e-485a-a5e8-9c93324d4b19</wsa:MessageID>
        <wsa:RelatesTo>uuid:dc728af7-fecb-49af-a0f3-8055f85526d0</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:To>
        <wsse:Security>
          <wsu:Timestamp wsu:Id="Timestamp-b792e6a2-01e5-48c2-b050-08d91e184a93">
            <wsu:Created>2007-02-23T12:25:13Z</wsu:Created>
            <wsu:Expires>2007-02-23T12:30:13Z</wsu:Expires>
          </wsu:Timestamp>
        </wsse:Security>
      </soap:Header>
      <soap:Body>
        <GsoGetUserDetailsResponse xmlns="http://www.gateway.gov.uk/soap/2007/02/public">
          <outputXml>
            &lt;?xml version="1.0" encoding="utf-8"?&gt;
            &lt;GsoGetUserDetailsXmlOutput
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            RequestID="0246DF5AC0984ADEAD6807F7A3797BA7"
            xmlns="urn:GSO-System-Services:external:1.65:GsoGetUserDetailsXmlOutput"&gt;
              &lt;CredentialName&gt;Martin Hollingsworth&lt;/CredentialName&gt;
              &lt;CredentialIdentifier&gt;0000001478270253&lt;/CredentialIdentifier&gt;
              &lt;Description&gt;Martin Hollingsworth - example account&lt;/Description&gt;
              &lt;EmailAddress&gt;martin@example.com&lt;/EmailAddress&gt;
              &lt;PasswordExpiryDateTime&gt;9999-12-31T23:59:59.9999999-00:00&lt;/PasswordExpiryDateTime&gt;
              &lt;UserType&gt;Principal&lt;/UserType&gt;
              &lt;AuthenticationType&gt;UserID&lt;/AuthenticationType&gt;
              &lt;RegistrationCategory&gt;Individual&lt;/RegistrationCategory&gt;
              &lt;CredentialRole&gt;User&lt;/CredentialRole&gt;
              &lt;TSchemeLevel&gt;SomeAssurance&lt;/TSchemeLevel&gt;
            &lt;/GsoGetUserDetailsXmlOutput&gt;
          </outputXml>
        </GsoGetUserDetailsResponse>
      </soap:Body>
    </soap:Envelope>

Notes:

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

> This value relates to the request. The value is either:

> - http://www.gateway.gov.uk/soap/2007/02/public/GsoGetUserDetailsResponse
> - urn:GSO-System-Services:external:1.65:PublicInterface/GsoGetUserDetailsResponse

> 2. <GsoGetUserDetailsResponse xmlns="...">

> This is the same as the namespace in the request GsoGetUserDetails element. The value is either:

> - http://www.gateway.gov.uk/soap/2007/02/public
> - urn:GSO-System-Services:external:1.65:PublicInterface

> 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