宿主机用的是IIS做的,在客户端象如下那样写,就能够访问
HelloServer obj2 = (HelloServer)Activator.GetObject(
typeof(ClassLibrary3.HelloServer),
"http://192.168.1.101/remoting/HelloServer.soap");
this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text);
HelloServer obj2=new HelloServer();
this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text);
在Web.config里加入如下,确不能正确访问宿主机:this.TextBox2.Text = obj2.HelloMethod(this.TextBox1.Text);
<system.runtime.remoting>
<application>
<client>
<!--<wellknown type="HelloServer, General" url="http://localhost:8090/SayHello" />-->
<wellknown
mode="Singleton"
type="ClassLibrary3.HelloServer,ClassLibrary3" url="http://192.168.1.101/remoting/HelloServer.soap" />
</client>
<channels>
<channel ref="http" useDefaultCredentials="true" />
</channels>
</application>
</system.runtime.remoting>
请大家指教下
<application>
<client>
<!--<wellknown type="HelloServer, General" url="http://localhost:8090/SayHello" />-->
<wellknown
mode="Singleton"
type="ClassLibrary3.HelloServer,ClassLibrary3" url="http://192.168.1.101/remoting/HelloServer.soap" />
</client>
<channels>
<channel ref="http" useDefaultCredentials="true" />
</channels>
</application>
</system.runtime.remoting>