Glossary Item Box

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

# GatewaySoapPublic.GsoGetEnrolmentsByService Method

This method returns a list of the direct enrolments in the specified service for the caller/caller's organisation.

public void GsoGetEnrolmentsByService(
string inputXml,
out string outputXml
);

#### Parameters

inputXml
  Input Xml for this method must have the namespace urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlInput
outputXml
  Output Xml for this method must have the namespace urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlOutput

#### Remarks

The input parameter is an XML document that contains the following elements:

- ServiceName: Name of the service.

The output parameter is an XML document that contains the following elements:

- Enrolment: For each enrolment:
  - ServiceName: Name of the service the enrolment is in
  - State: State of the enrolment (NotYetActivated, Activated, HandedToAgent, Pending)
  - FriendlyName: Description of the enrolment
  - IdentifiersForDisplay: The Identifiers returned
  - AllocatedAgents: The AgentDetails for each agent:
    - AgentID: Name selected by Agent
    - AgentCode: Uniquely identifies the Agent (generated by the Gateway when the Agent organisation was created)
    - AgentFriendlyName: Short description selected by Agent

The schema for the input document is as follows (this xsd references GsoCore.xsd):

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema targetNamespace="urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlInput" xmlns="urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlInput" xmlns:core="urn:GSO-System-Services:external:1.65:GsoCore" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0">
      <xs:import namespace="urn:GSO-System-Services:external:1.65:GsoCore" />
      <xs:element name="GsoGetEnrolmentsByServiceXmlInput">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="ServiceName" type="core:ServiceNameTYPE" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>

The schema for the output document is as follows (this xsd references GsoCore.xsd and GsoCore168.xsd):

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema targetNamespace="urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlOutput" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:core="urn:GSO-System-Services:external:1.65:GsoCore" xmlns:core168="urn:GSO-System-Services:external:1.68:GsoCore" xmlns="urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlOutput" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0">
      <xs:import namespace="urn:GSO-System-Services:external:1.65:GsoCore"/>
      <xs:import namespace="urn:GSO-System-Services:external:1.68:GsoCore"/>
      <xs:element name="GsoGetEnrolmentsByServiceXmlOutput">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Enrolments">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Enrolment" type="EnrolmentType" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="RequestID" type="core:HashTokenTYPE" use="required"/>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="AgentDetailsType">
        <xs:sequence>
          <xs:element name="AgentID" type="core:AgentIDTYPE"/>
          <xs:element name="AgentCode" type="core:AgentCodeTYPE"/>
          <xs:element name="AgentFriendlyName" type="core:AgentFriendlyNameTYPE"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="EnrolmentType">
        <xs:sequence>
          <xs:element name="ServiceName" type="core:ServiceNameTYPE"/>
          <xs:element name="State" type="core168:EnrolmentStateTYPE"/>
          <xs:element name="FriendlyName" type="core:EnrolmentFriendlyNameTYPE"/>
          <xs:element name="IdentifiersForDisplay">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="IdentifierForDisplay" type="core:IdentifierForDisplayTYPE" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="AllocatedAgents" minOccurs="0">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="AgentDetails" type="AgentDetailsType" maxOccurs="unbounded"/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>

#### Method Details

This method will not return any direct enrolments if the caller's authentication level does not meet the service's minimum required authentication level.

The calling credential can be a principal (individual or organisation) or an agent.

Note: An enrolment State of Pending will be returned if an enrolment is currently being processed. This will only occur for an enrolment in a service that uses distributed known facts (DKFs). DKFs require an enrolment's known facts to be sent to, and checked, on the service back-end system (and identifiers returned) before the enrolment can be register on the Gateway.

#### Method Steps

This method performs the following steps:

- Gets the list of direct enrolment's in the specified service for the caller/caller's organisation.
- The list is filtered to remove any services with a minimum required authentication level that is greater than the credential's authentication level.

#### Calling Credential

The credential calling the function must meet the following rules

Rule | Error
--- | ---
The Credential must present a 'Standard' GatewayToken | wsse:FailedAuthentication Presenting the incorrect token will produce the standard wsse:FailedAuthentication exception
The Credential must NOT be of the following type: Admin | 8006: The Credential type specified is invalid Specific methods can only be performed for certain types of Credential (e.g. Principal, Agent, Admin etc.), if the supplied Credential is of the wrong type for the method then this exception will be raised.
The Credential must be in the following roles: User | 8026: The credential has the wrong type of role The credential has the wrong type of role to be used with this function. e.g. The credential is an assistant where a peer is required.
The Credential's state must be: Active | 8005: The Credential has an invalid state for this action Each Credential has a number of states (e.g. Registered, Suspended), and specific methods require the Credential to be in a certain state. If the Credential is in the wrong state then this exception will be raised

#### Business Rules

All errors will return a SOAP fault. The GatewayDetails node will include ErrorNumber. It also contains a Message node with a detailed description of the cause of the error. The following is a list of the Error Numbers that may be returned from this method, each one represents a business rule that has been broken:

SOAP Fault Error Number | Description
--- | ---
3002 | The service specified does not exist The Service supplied to the method does not exist on the Gateway
8002 | The specified Credential does not exist If a method is given the details of a Credential that does not exist then this exception will be raised
8004 | The credential’s current authentication level is not high enough to perform this action The credential does not have a high enough authentication level to perform the requested action
13005 | The service is not valid for the registration category The registration profile can only be used for specific services. If a service is chosen that does not support this registration category then this exception will be thrown

#### Audit Events

Audit Events are stored in the Audit Database. These events are not available publicly. Please contact Live Services for more information

Audit ID | Description
--- | ---
506 | GsoAuthorisation (Failure)

#### Notifications

Notifications are messages that originate from the Gateway and sent to an external source.

Notification | Description
--- | ---

#### Example

The following is a sample of an input document:

    <?xml version="1.0" encoding="utf-8"?>
    <GsoGetEnrolmentsByServiceXmlInput xmlns="urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlInput">
      <ServiceName>MOSW2</ServiceName>
    </GsoGetEnrolmentsByServiceXmlInput>

The following is a sample of an output document:

    <?xml version="1.0" encoding="utf-8"?>
    <GsoGetEnrolmentsByServiceXmlOutput xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RequestID="F7071E5182B848189DA0CD22FE0ABFB4" xmlns="urn:GSO-System-Services:external:1.68:GsoGetEnrolmentsByServiceXmlOutput">
      <Enrolments>
        <Enrolment>
          <ServiceName>MOSW2</ServiceName>
          <State>Activated</State>
          <FriendlyName />
          <IdentifiersForDisplay>
            <IdentifierForDisplay Type="MOSW2ID" Value="1234569" MaskedValue="1*3*5*9" />
            <IdentifierForDisplay Type="MOSW2Number" Value="123" MaskedValue="1*3" />
          </IdentifiersForDisplay>
          <AllocatedAgents>
            <AgentDetails>
              <AgentID>MICROSOFT</AgentID>
              <AgentCode>JQ8AUJ33BVHC</AgentCode>
              <AgentFriendlyName>The Main Agent</AgentFriendlyName>
            </AgentDetails>
          </AllocatedAgents>
        </Enrolment>
      </Enrolments>
    </GsoGetEnrolmentsByServiceXmlOutput>

#### See Also

Public Interface

© Crown Copyright 2008. All rights reserved