Пример #1
0
        /// <summary>
        /// Receive IncomingMessageXml (string), return OutgoingMessage (object)
        /// </summary>
        /// <param name="session"></param>
        /// <param name="dspModel"></param>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool DispatchXDSGWMessage(SOAPReceiverSession session, MessageDispatchModel dspModel, EntityImpl entity)
        {
            if (session == null ||
                session.Status != SOAPReceiverSessionStatus.IncomingMessageXmlGenerated)
            {
                return(false);
            }

            switch (dspModel)
            {
            case MessageDispatchModel.Publish: return(DispatchXDSGWMessage_Publish(session, entity));

            case MessageDispatchModel.Request: return(DispatchXDSGWMessage_Request(session, entity));

            case MessageDispatchModel.Custom: return(DispatchXDSGWMessage_Custom(session, entity));

            case MessageDispatchModel.Test: return(DispatchXDSGWMessage_Test(session));
            }

            return(false);
        }
Пример #2
0
        public bool ProcessSoapSession(SOAPReceiverSession session, MessageDispatchModel dspModel, EntityImpl entity)
        {
            if (session == null ||
                session.Status != SOAPReceiverSessionStatus.IncomingSOAPEnvelopeReceived)
            {
                return(false);
            }

            if (_context.Log.DumpData)
            {
                DumpSoapMessage(string.Format("{0}_soap_req.xml", session.SessionID), session.IncomingSOAPEnvelope);
            }

            string incomingMsgXml = "";

            if (GenerateXDSGWMessage(session.IncomingSOAPEnvelope, out incomingMsgXml))
            {
                session.IncomingMessageXml = incomingMsgXml;
                if (DispatchXDSGWMessage(session, dspModel, entity) && session != null &&
                    session.Status == SOAPReceiverSessionStatus.OutgoingMessageReceived)
                {
                    string outgoingSoapEnvelope = "";
                    if (GenerateSOAPMessage(session.OutgoingMessage, out outgoingSoapEnvelope))
                    {
                        session.OutgoingSOAPEnvelope = outgoingSoapEnvelope;

                        if (_context.Log.DumpData)
                        {
                            DumpSoapMessage(string.Format("{0}_soap_rsp.xml", session.SessionID), session.OutgoingSOAPEnvelope);
                        }

                        return(true);
                    }
                }
            }

            return(false);
        }