Esempio n. 1
0
        protected virtual void ProcessWebServiceSolicitSource(ScheduledItem scheduledItem, Activity activity,
                                                              string transactionId)
        {
            PartnerIdentity partner = _partnerManager.GetById(scheduledItem.SourceId);

            if (partner == null)
            {
                throw new ArgumentException(string.Format("Invalid partner id \"{0}.\"  Could not find partner for scheduled item \"{1}\".",
                                                          scheduledItem.TargetId, scheduledItem.Name));
            }

            string filePath = Path.Combine(SettingsProvider.TempFolderPath, GetResultFileName(scheduledItem));

            string networkTransactionId;
            EndpointVersionType endpointVersion;
            string endpointUrl;
            string networkFlowName = null, networkFlowOperation = scheduledItem.SourceRequest;

            using (INodeEndpointClient client = GetNodeClient(partner, activity, scheduledItem.SourceEndpointUser))
            {
                try
                {
                    if (client.Version == EndpointVersionType.EN11)
                    {
                        networkTransactionId = client.Solicit(null, scheduledItem.SourceRequest, scheduledItem.GetTranformedSourceArgs(),
                                                              new string[] { SettingsProvider.Endpoint11Url });
                    }
                    else
                    {
                        networkTransactionId = client.Solicit(scheduledItem.SourceFlow, scheduledItem.SourceRequest,
                                                              scheduledItem.GetTranformedSourceArgs(),
                                                              new string[] { SettingsProvider.Endpoint20Url });
                        networkFlowName = scheduledItem.SourceFlow;
                    }
                }
                catch (Exception e)
                {
                    LogActivityError(activity, "Error returned from node endpoint: \"{0}\"", ExceptionUtils.GetDeepExceptionMessage(e));
                    throw;
                }
                endpointVersion = client.Version;
                endpointUrl     = client.Url;
            }
            LogActivity(activity, "Performed Solicit of partner \"{0}\" at url \"{1}\" with returned transaction id \"{2}\"",
                        partner.Name, partner.Url, networkTransactionId);
            _transactionManager.SetNetworkIdAndEndpointUserId(transactionId, networkTransactionId, endpointVersion, endpointUrl,
                                                              networkFlowName, networkFlowOperation,
                                                              null, scheduledItem.SourceEndpointUser);
            //_transactionManager.SetNetworkId(transactionId, networkTransactionId, endpointVersion, endpointUrl,
            //                                 networkFlowName, networkFlowOperation);
        }
Esempio n. 2
0
        protected virtual string PerformSolicit()
        {
            string transactionId;

            AppendAuditLogEvent("Soliciting endpoint \"{0}\" at url \"{1}\" with flow name \"{2}\" and service name \"{3}\"",
                                _solicitPartner.Name, _solicitPartner.Url, NETWORK_RCRA_FLOW_NAME, _queryServiceName);

            try
            {
                using (INodeEndpointClient endpointClient =
                           _endpointUserManager.GetNodeEndpointClient(_solicitPartner.Url, _solicitPartner.Version, _solicitEndpointUsername))
                {
                    transactionId = endpointClient.Solicit(NETWORK_RCRA_FLOW_NAME, _queryServiceName, _queryParameters);
                }
                AppendAuditLogEvent("Successfully solicited the node endpoint \"{0}\" with returned transaction id \"{1}\"",
                                    _solicitPartner.Name, transactionId);
            }
            catch (Exception e)
            {
                AppendAuditLogEvent("Failed to solicit the node endpoint \"{0}\" with exception: {1}",
                                    _solicitPartner.Name, ExceptionUtils.GetDeepExceptionMessage(e));
                throw;
            }
            _endpointUserManager.SetNetworkEndpointTransactionInfo(_dataRequest.TransactionId, transactionId, _solicitPartner.Version,
                                                                   _solicitPartner.Url, NETWORK_RCRA_FLOW_NAME, _queryServiceName,
                                                                   _solicitEndpointUsername);
            return(transactionId);
        }