public void ReadMSG(MsgProtocol msgProtocol, byte[] msg) { if (onlineComponents.Count > 0) { onlineComponents.Find(item => item.MsgProtocol == msgProtocol).ReadMSG(msg); } }
public static string getContentType(MessageFormat.MessageContentType messageContentType = MessageFormat.MessageContentType.Xml, MsgProtocol msgProtocol = MsgProtocol.Interop) { string contentType = "application/"; if (msgProtocol == MsgProtocol.SOAP) { contentType += "soap+"; } switch (messageContentType) { case MessageFormat.MessageContentType.Xml: contentType += "xml"; break; case MessageFormat.MessageContentType.FastInfoSet: contentType += "fastinfoset"; break; case MessageFormat.MessageContentType.Json: contentType += "json"; break; ////text/csv+tab case MessageFormat.MessageContentType.CSVTab: contentType = "text/csv+tab"; break; default: throw new Exception("Can't parse unsupported ContentType for request, not able to send request."); } return(contentType); }
public CommunicationInformation(String uri, MsgProtocol protocol = MsgProtocol.Interop, MessageFormat.MessageContentType contentType = MessageFormat.MessageContentType.FastInfoSet, MessageEncodeDecode.MessageContentEncoding contentEncoding = MessageEncodeDecode.MessageContentEncoding.None, bool withE3JRequestHeader = true, HTTPSendMode httpSendMode = HTTPSendMode.POST) { this.URI = uri; this.MessageProtocol = protocol; this.ContentType = contentType; this.ContentEncoding = contentEncoding; this.HttpSendMode = httpSendMode; WithE3JRequestHeader = withE3JRequestHeader; }
public static MemoryStream DetachProtocol(MemoryStream ms, MsgProtocol mp) { if (mp == MsgProtocol.SOAP) { return(SOAPProtocol.GetSOAPBody(ms)); } else if (mp == MsgProtocol.Interop) { return(ms); // There is no Header } throw new ArgumentOutOfRangeException("commInfo.MessageProtocol"); }
static int _CreateMsgProtocol(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { MsgProtocol obj = new MsgProtocol(); LuaScriptMgr.PushObject(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: MsgProtocol.New"); } return(0); }
public static string getContextType(MessageFormat.MessageContentType messageContentType = MessageFormat.MessageContentType.Xml, MsgProtocol msgProtocol = MsgProtocol.Interop) { string contextType = ""; if (messageContentType == MessageFormat.MessageContentType.FastInfoSet && msgProtocol == MsgProtocol.Interop) { contextType = "application/fastinfoset"; } if (messageContentType == MessageFormat.MessageContentType.Xml && msgProtocol == MsgProtocol.Interop) { contextType = "application/xml"; } if (messageContentType == MessageFormat.MessageContentType.FastInfoSet && msgProtocol == MsgProtocol.SOAP) { contextType = "application/soap+fastinfoset"; } if (messageContentType == MessageFormat.MessageContentType.Xml && msgProtocol == MsgProtocol.SOAP) { contextType = "application/soap+xml"; } return(contextType); }