/// <summary>
        /// Adds <paramref name="datasourceBean"/> to <paramref name="datasourceType"/>
        /// </summary>
        /// <param name="datasourceBean">
        /// The <see cref="IDataSource"/>.
        /// </param>
        /// <param name="datasourceType">
        /// The <see cref="DataSourceType"/>
        /// </param>
        public void AddDatasource(IDataSource datasourceBean, DataSourceType datasourceType)
        {
            if (datasourceBean.SimpleDatasource)
            {
                datasourceType.SimpleDataSource.Add(datasourceBean.DataUrl);
            }
            else
            {
                var queryableDatasourceType = new QueryableDataSourceType();
                datasourceType.QueryableDataSource.Add(queryableDatasourceType);
                queryableDatasourceType.DataURL = datasourceBean.DataUrl;
                queryableDatasourceType.isRESTDatasource = datasourceBean.RESTDatasource;
                queryableDatasourceType.isWebServiceDatasource = datasourceBean.WebServiceDatasource;
                if (datasourceBean.WsdlUrl != null)
                {
                    queryableDatasourceType.WSDLURL = datasourceBean.WsdlUrl;
                }

                if (datasourceBean.WadlUrl != null)
                {
                    queryableDatasourceType.WADLURL = datasourceBean.WadlUrl;
                }
            }
        }
        /// <summary>
        /// Process the response.
        /// </summary>
        /// <param name="returnType">
        /// The return type.
        /// </param>
        /// <param name="registrationBean">
        /// The registration bean.
        /// </param>
        /// <param name="exception">
        /// The exception.
        /// </param>
        private void ProcessResponse(
            SubmitRegistrationsResponseType returnType, IRegistrationObject registrationBean, Exception exception)
        {
            var registrationStatusType = new RegistrationStatusType();
            returnType.RegistrationStatus.Add(registrationStatusType);
            var statusMessageType = new StatusMessageType();
            registrationStatusType.StatusMessage = statusMessageType;

            this.AddStatus(statusMessageType, exception);
            var registrationType = new RegistrationType();
            registrationStatusType.Registration = registrationType;
            registrationType.id = registrationBean.Id;
            if (registrationBean.DataSource != null)
            {
                IDataSource datasourceBean = registrationBean.DataSource;
                var datasourceType = new DataSourceType();
                registrationType.Datasource = datasourceType;

                if (datasourceBean.SimpleDatasource)
                {
                    Uri simpleDatasourceType = datasourceBean.DataUrl;
                    datasourceType.SimpleDataSource.Add(simpleDatasourceType);
                }
                else
                {
                    var queryableDatasource = new QueryableDataSourceType();
                    datasourceType.QueryableDataSource.Add(queryableDatasource);
                    queryableDatasource.isRESTDatasource = datasourceBean.RESTDatasource;
                    queryableDatasource.isWebServiceDatasource = datasourceBean.WebServiceDatasource;
                    queryableDatasource.DataURL = datasourceBean.DataUrl;
                    if (datasourceBean.WsdlUrl != null)
                    {
                        queryableDatasource.WSDLURL = datasourceBean.WsdlUrl;
                    }

                    if (datasourceBean.WadlUrl != null)
                    {
                        queryableDatasource.WADLURL = datasourceBean.WadlUrl;
                    }
                }
            }

            if (registrationBean.ProvisionAgreementRef != null)
            {
                var refType = new ProvisionAgreementReferenceType();
                registrationType.ProvisionAgreement = refType;
                refType.URN.Add(registrationBean.ProvisionAgreementRef.TargetUrn);
            }
        }