Hellow everyone,
In one of my apps, I have to change the default typeFilterLevel setting
from "Low" to "Full" (The typeFilterLevel is a property of
BinaryServerFormatterSinkProvider which control the automatic
deserialization level.). When I host my buiseness type with a server
program, I use following code to do that and it can work.
BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props = new Hashtable();
props["port"] = 9000;
TcpChannel chan = new TcpChannel(props, null, provider);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType
(Type.GetType
("Etone.RegistBiz.RegistTx,RegistBiz"),
"RegistTrans",
WellKnownObjectMode.SingleCall);
RemotingConfiguration.RegisterWellKnownServiceType
(Type.GetType
("Etone.RegistBiz.RegistQry,RegistBiz"),
"RegistQuery",
WellKnownObjectMode.Singleton);
..
the question one is why following configuration file can't work to do the
same thing?
the question two is, when I host the class with IIS, I can not do that by
code or configuration. the Web.config file is as:
the Global.asax page file is as:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Runtime.Remoting" %>
<%@ Import Namespace="System.Runtime.Remoting.Channels" %>
<%@ Import Namespace="System.Runtime.Remoting.Channels.Http" %>
<%@ Import Namespace="System.Runtime.Serialization.Formatters" %>
<%@ Import Namespace="Etone.RegistBiz" %>
<%@ Assembly Name="System.Runtime.Remoting" %>
void Application_Start()
{
//Regist remoting class by code
BinaryServerFormatterSinkProvider provider = new
BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;
IDictionary props = new Hashtable();
props["name"] = "MyChannel";
props["priority"] = "100";
HttpChannel chan = new HttpChannel(props, null, provider);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType
(Type.GetType("Etone.RegistBiz.RegistTx,RegistBiz"),
"RegistTrans.rem", WellKnownObjectMode.SingleCall);
RemotingConfiguration.RegisterWellKnownServiceType
(Type.GetType("Etone.RegistBiz.RegistQry,RegistBiz"),
"RegistQuery.rem", WellKnownObjectMode.Singleton);
}
the Machine.config file is not modified. who can point out the errores in
my code and configuration file or explain the reasones for me?
Thanks in advance!
Raymond
Software Engineer
Etone network tech limited.
===
This list is hosted by DevelopMentorĀ® http://www.develop.com
Some .NET courses you may be interested in:
Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls
Guerrilla .NET, 8 Dec 2003, in Los Angeles
http://www.develop.com/courses/gdotnet
View archives and manage your subscription(s) at http://discuss.develop.com