Glossary Item Box

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

# GatewaySoapPublic.GsoGetEligibleService Method

This method checks if the calling credential is eligible for an enrolment in the specified service.

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

#### Parameters

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

#### Remarks

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

- ServiceName: The name of the Service to check

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:GsoGetEligibleServiceXmlInput" xmlns="urn:GSO-System-Services:external:1.65:GsoGetEligibleServiceXmlInput" 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="GsoGetEligibleServiceXmlInput">
        <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):

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema targetNamespace="urn:GSO-System-Services:external:1.65:GsoGetEligibleServiceXmlOutput" 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:GsoGetEligibleServiceXmlOutput" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0">
      <xs:import namespace="urn:GSO-System-Services:external:1.65:GsoCore" />
      <xs:element name="GsoGetEligibleServiceXmlOutput">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Service">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="ServiceOwner" type="core:ServiceOwnerTYPE" />
                  <xs:element name="Name" type="core:ServiceNameTYPE" />
                  <xs:element name="Description" type="core:TextDataTYPE" />
                  <xs:element name="HelpText" type="core:TextDataTYPE" />
                  <xs:element name="HelpUrl" type="core:TextDataTYPE" />
                </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

If the credential of the calling principal or agent user is not eligible to enrol in a service a business rule violation will be raised describing the reason. Even if a user violates multiple business rules only the first violation will be raised.

Please note that even though the Credential may be eligible for an enrolment in the specified service, the credential can only enrol with valid known facts.

#### Method Steps

This method performs the following steps:

- Checks if the caller is eligible for an enrolment in the service
- Returns the service information

#### 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'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
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.

#### 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
3003 | The Service is not in an active state For this method to be executed the Service State has to be active.
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
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
10004 | Multiple Enrolments are not valid for this service. The service flag MultipleEnrolment determines if a Credential is allowed to have more than one enrolment in a Service, using different Identifiers. If a Credential attempts to Enrol more than once in a Service that does not allow Multiple Enrolments then this exception will be thrown.
10005 | The Credential is already using these identifiers for an existing enrolment in the service. The service flag MultipleEnrolments allows a Credential to enrol more than once in a service, and the service flag UniqueIdentifiers allows a service to accept existing identifiers for a new enrolment. However even with both these service flags a Credential is not allowed to enrol more than once in a service using the same identifiers.
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"?>
    <GsoGetEligibleServiceXmlInput xmlns="urn:GSO-System-Services:external:1.65:GsoGetEligibleServiceXmlInput">
      <ServiceName>MOSW1</ServiceName>
    </GsoGetEligibleServiceXmlInput>

The following is a sample of an output document:

    <?xml version="1.0" encoding="utf-8"?>
    <GsoGetEligibleServiceXmlOutput RequestID="447C78C2A1B448F5BC74C816612552CD" xmlns="urn:GSO-System-Services:external:1.65:GsoGetEligibleServicesXmlOutput">
      <Services>
        <Service>
          <ServiceOwner>MOSW</ServiceOwner>
          <Name>MOSW2</Name>
          <Description>MOSW2 Test Service</Description>
          <HelpText>This is the help text</HelpText>
          <HelpUrl>www.gateway.gov.uk</HelpUrl>
        </Service>
      </Services>
    </GsoGetEligibleServiceXmlOutput>

#### See Also

Public Interface

© Crown Copyright 2008. All rights reserved