Exemple #1
0
        public void AfterReceiveReply(ref Message reply, object correlationState)
        {
            MessageBuffer buffer = reply.CreateBufferedCopy(int.MaxValue);
            Message       mess   = buffer.CreateMessage();
            MemoryStream  ms     = new MemoryStream();
            XmlWriter     writer = XmlWriter.Create(ms);

            mess.WriteMessage(writer);
            writer.Flush();
            ms.Position = 0;
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(ms);
            //this.ChangeMessage(xmlDoc);
            reply = buffer.CreateMessage();
            BaseSoapHolder holder = new BaseSoapHolder();

            holder.SoapContext = SoapContext.Reply;
            holder.XmlDocument = xmlDoc;
            ReturnMessageXml?.Invoke(holder, new EventArgs());
        }
Exemple #2
0
        public object BeforeSendRequest(ref Message request, System.ServiceModel.IClientChannel channel)
        {
            MessageBuffer buffer = request.CreateBufferedCopy(int.MaxValue);
            Message       mess   = buffer.CreateMessage();
            MemoryStream  ms     = new MemoryStream();
            XmlWriter     writer = XmlWriter.Create(ms);

            mess.WriteMessage(writer);
            writer.Flush();
            ms.Position = 0;
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(ms);
            //this.ChangeMessage(xmlDoc);
            BaseSoapHolder holder = new BaseSoapHolder();

            holder.SoapContext = SoapContext.Request;
            holder.XmlDocument = xmlDoc;
            request            = buffer.CreateMessage();
            ReturnMessageXml?.Invoke(holder, new EventArgs());
            return(null);
        }
Exemple #3
0
 void cmi_ReturnMessageXML(object sender, EventArgs e)
 {
     ReturnMessageXml?.Invoke(sender, e);
 }
Exemple #4
0
 /// <summary>
 /// Used to return the soap messages that the proxies send and receive.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ReturnMessageXMLHandler(object sender, EventArgs e)
 {
     ((BaseSoapHolder)sender).Call = OperationContext;
     ReturnMessageXml?.Invoke(sender, e);
 }