/// <summary>
        /// <see cref="Sif.Framework.Consumer.IGenericConsumer{T,PK}.Retrieve(PK)">Retrieve</see>
        /// </summary>
        public virtual T Retrieve(PK id)
        {
            if (!registrationService.Registered)
            {
                throw new InvalidOperationException("Consumer has not registered.");
            }

            string url = EnvironmentUtils.ParseServiceUrl(environmentTemplate) + "/" + TypeName + "s" + "/" + id;
            string xml = HttpUtils.GetRequest(url, registrationService.AuthorisationToken);

            if (log.IsDebugEnabled)
            {
                log.Debug("XML from GET request ...");
            }
            if (log.IsDebugEnabled)
            {
                log.Debug(xml);
            }
            return(ObjectSerialiser.Deserialise(xml));
        }
        /// <summary>
        /// <see cref="Sif.Framework.Consumer.IGenericConsumer{T,PK}.Create(T)">Create</see>
        /// </summary>
        public virtual PK Create(T obj)
        {
            if (!registrationService.Registered)
            {
                throw new InvalidOperationException("Consumer has not registered.");
            }

            string url  = EnvironmentUtils.ParseServiceUrl(environmentTemplate) + "/" + TypeName + "s" + "/" + TypeName;
            string body = ObjectSerialiser.Serialise(obj);
            string xml  = HttpUtils.PostRequest(url, registrationService.AuthorisationToken, body);

            if (log.IsDebugEnabled)
            {
                log.Debug("XML from POST request ...");
            }
            if (log.IsDebugEnabled)
            {
                log.Debug(xml);
            }
            return((ObjectSerialiser.Deserialise(xml)).Id);
        }