`

如何检测Remote Objects是否部署成功

 
阅读更多
<iframe align="top" marginwidth="0" marginheight="0" src="http://www.zealware.com/46860.html" frameborder="0" width="468" scrolling="no" height="60"></iframe>

  在调试.Net Remoting程序时,经常会出现一些莫名其妙的问题,IDE提示的异常信息有时也不一定正确。很多时候都是自己粗心,配置configuration文件上出了问题,包括ClientServer端的配置文件。
  
言归正传,这里看看如何检测Remote Objects是否部署成功。Remote Objects部署成功是第一步,否则Client端调用Remote Objects肯定会抛异常信息了。因此,如出现异常信息,首先检测Remote Objects是否成功部署在Server端。

下面根据激活类型分两种情况:SAO(服务端激活对象)和CAO(客户端激活对象)。

1SAO对象

SAO对象而言,比较简单。根据Server端配置文件中<wellknown></wellknown>节或RemotingConfiguration.RegisterWellKnownServiceType()方法中指定的URL,通过IE浏览器检测,如下所示:

http://<hostname>:<port>/<applicationname>/<url>?wsdl<p></p></url></applicationname></port></hostname>

如果IE返回WSDL信息,则显示Remote Objects部署成功。其实只要看到IE有正确返回信息就行了,如果你了解WSDLWeb Services Description Language),可以进一步看看是否调用的Remote Method是否有出现。

需要注意的地方:

1)如果Remote Objects部署在IIS中,<applicationname></applicationname>则为虚拟目录名称(Virtual Directory Name),并且不要在Web.Config配置文件中设定Application Name。同时Remote ObjectsURL需要以soaprem为后缀名。

2)如果Remote Objects不是部署在IIS中,则必须在configuration配置文件或者在代码中RemotingConfiguration.Application=”<applicationname>”</applicationname>来指定ApplicationName

2CAO对象

对于CAO对象,和SAO对象不一样。需要如下的URL来测试:

http://<hostname>:<port>/<applicationname>/RemoteActivationService.rem?wsdl<p></p></applicationname></port></hostname>

后面是RemoteActivationService.rem,这点和SAO对象不一样。

需要注意的地方:

在调用CAO对象时,需要在Client端的配置文件中<client></client>节指定Remote Objectsurl属性。



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1793987


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics