Glossary Item Box

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

# GatewaySoapPublic.GsoGetPeers Method

This method returns all peers in the calling credential's organisation.

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

#### Parameters

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

#### Remarks

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

- Root node only (no parameters are required)

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:GsoGetPeersXmlInput" xmlns="urn:GSO-System-Services:external:1.65:GsoGetPeersXmlInput" 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="GsoGetPeersXmlInput">
        <xs:complexType />
      </xs:element>
    </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:GsoGetPeersXmlOutput" xmlns="urn:GSO-System-Services:external:1.65:GsoGetPeersXmlOutput" 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="GsoGetPeersXmlOutput">
        <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

The list of peers returned from the method will include the calling user.

#### Method Steps

This method performs the following steps:

- Checks that the calling user is a not an assistant
- Returns information about the peers

#### 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 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 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
--- | ---
13006 | The Registration Profile does not exist The Registration Profile that has been supplied does not exist

#### 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"?>
    <GsoGetPeersXmlInput xmlns="urn:GSO-System-Services:external:1.65:GsoGetPeersXmlInput" />

The following is a sample of an output document:

    <?xml version="1.0" encoding="utf-8"?>
    <GsoGetPeersXmlOutput xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RequestID="9C6198E73EF14B0BA1ADE1DAC0530201" xmlns="urn:GSO-System-Services:external:1.65:GsoGetPeersXmlOutput">
      <CredentialIdentifier>0000001223179602</CredentialIdentifier>
      <Name>James Brown</Name>
      <Description />
      <EmailAddress>james@email.com</EmailAddress>
      <CreatedBy>0000001256182642</CreatedBy>
      <DateCreated>2003-09-23T14:36:02.2841943-00:00</DateCreated>
    </GsoGetPeersXmlOutput>

#### See Also

Public Interface

© Crown Copyright 2008. All rights reserved