Glossary Item Box

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

# GatewaySoapPublic.GsoGetAssignedPeersByEnrolment Method

This method returns all of the peers that are assigned to a direct enrolment.

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

#### Parameters

inputXml
  Input Xml for this method must have the namespace urn:GSO-System-Services:external:1.65:GsoGetAssignedPeersByEnrolmentXmlInput
outputXml
  Output Xml for this method must have the namespace urn:GSO-System-Services:external:1.65:GsoGetAssignedPeersByEnrolmentXmlOutput

#### Remarks

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

- DirectEnrolment: The enrolment to filter on

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.65:GsoGetAssignedPeersByEnrolmentXmlInput" xmlns="urn:GSO-System-Services:external:1.65:GsoGetAssignedPeersByEnrolmentXmlInput" 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="GsoGetAssignedPeersByEnrolmentXmlInput">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="DirectEnrolment" type="DirectEnrolmentType" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="DirectEnrolmentType">
        <xs:sequence>
          <xs:element name="ServiceName" type="core:ServiceNameTYPE" />
          <xs:element name="Identifiers">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Identifier" type="core:IdentifierTYPE" maxOccurs="unbounded" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>

The schema for the output 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.65:GsoGetAssignedPeersByEnrolmentXmlOutput" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:core="urn:GSO-System-Services:external:1.65:GsoCore" xmlns="urn:GSO-System-Services:external:1.65:GsoGetAssignedPeersByEnrolmentXmlOutput" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0">
      <xs:import namespace="urn:GSO-System-Services:external:1.65:GsoCore" />
      <xs:element name="GsoGetAssignedPeersByEnrolmentXmlOutput">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Peers">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Peer" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="CredentialIdentifier" type="core:CredentialIdentifierTYPE" />
                        <xs:element name="Name" type="core:CredentialNameTYPE" />
                        <xs:element name="Description" type="core:CredentialDescriptionTYPE" />
                        <xs:element name="EmailAddress" type="core:EmailAddressTYPE" />
                        <xs:element name="CreatedBy" type="core:CredentialIdentifierTYPE" nillable="true" />
                        <xs:element name="DateCreated" type="xs:dateTime" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="RequestID" type="core:HashTokenTYPE" use="required" />
        </xs:complexType>
      </xs:element>
    </xs:schema>

#### Method Details

None.

#### Method Steps

This method performs the following steps:

- Checks that this enrolment exists
- Returns all of the users that have assignments to this direct enrolment

#### 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 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 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 the member of a Group | 8029: The Credential is not a member of an Organisation If the credential's registration category allows either peers or assistants then they are deemed to belong to an Organisation. This exception is raised when a Credential who does not belong to an Organisation attempts to call a method that controls Organisation specific functionality.
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
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
10002 | The enrolment or client allocation does not exist If a method cannot locate the enrolment or client allocation using the supplied information then this exception will be raised.
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"?>
    <GsoGetAssignedPeersByEnrolmentXmlInput xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:GSO-System-Services:external:1.65:GsoGetAssignedPeersByEnrolmentXmlInput">
      <DirectEnrolment>
        <ServiceName>MOSW5</ServiceName>
        <Identifiers>
          <Identifier IdentifierType="MOSW5PostCode">13 6GH</Identifier>
          <Identifier IdentifierType="MOSW5Reference">DV200L</Identifier>
        </Identifiers>
      </DirectEnrolment>
    </GsoGetAssignedPeersByEnrolmentXmlInput>

The following is a sample of an output document:

    <?xml version="1.0" encoding="utf-8"?>
    <GsoGetAssignedPeersByEnrolmentXmlOutput xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RequestID="0647F5018AE349DFBB17DF7A71D12044" xmlns="urn:GSO-System-Services:external:1.65:GsoGetAssignedPeersByEnrolmentXmlOutput">
      <Peers>
        <Peer>
          <CredentialIdentifier>0000001258364518</CredentialIdentifier>
          <Name>Nikki Hawkridge</Name>
          <Description>Nikki - Additional Credential Information</Description>
          <EmailAddress>nikki@email.com</EmailAddress>
          <CreatedBy>0000001249568289</CreatedBy>
          <DateCreated>2003-09-25T13:34:20.0900000+01:00</DateCreated>
        </Peer>
      </Peers>
    </GsoGetAssignedPeersByEnrolmentXmlOutput>

#### See Also

Public Interface

© Crown Copyright 2008. All rights reserved