使用URL重定向代替WCF服务的输入参数 [英] Using URL redirect instead of input param for WCF service

查看:84
本文介绍了使用URL重定向代替WCF服务的输入参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Dynamics CRM中调查Organization.svc时,我发现它使用URL重定向来更改组织。

While investigating the Organization.svc in Dynamics CRM, I found that it is using URL redirect for changing the Organizations. That means for each Organization it simulate URL to access Organization.svc.

只有一个SVC文件,但是有多个URL可以访问它,例如。组织Org1将具有URL http://CRMserver_name/Org1/XRMServices/2011/Organization.svc ,而Org2将具有 http:// CRMserver_name / Org2 /XRMServices/2011/Organization.svc

There is just one SVC file but multiple URLs to access it e.g. Organization Org1 will have URL http://CRMserver_name/Org1/XRMServices/2011/Organization.svc and Org2 will have http://CRMserver_name/Org2/XRMServices/2011/Organization.svc

我想知道这样做与将输入参数传递给SVC相比是否有任何好处。请分享您对这两件事的利弊的看法。

I was wondering if there is any benefits for doing this as compare to passing input param to SVC. Please share your thoughts on the pros and cons for these two things.

推荐答案

我今天学到了一些新知识。如果您已经知道,请原谅我。

I learned something new today. Pardon me if you know this already.

有两件事–


  1. URL路由- http://msdn.microsoft.com/en-us/library /ee358760.aspx

  2. URL重写- http://msdn.microsoft.com/en-us/library/ms972974.aspx

  1. URL routing - http://msdn.microsoft.com/en-us/library/ee358760.aspx
  2. URL rewrite - http://msdn.microsoft.com/en-us/library/ms972974.aspx

URL路由是终极的事情。它完全是虚拟的,不需要在IIS中注册路由。所以现在我知道为什么Dynamics CRM使用它了。使用路由客户端不需要为WCF服务的每个方法调用指定组织名称。创建客户端对象时,URL本身会提供该信息。客户端只需要这样做一次,所有方法现在都知道特定WCF调用的组织名称。

URL routing is ultimate thing. It is totally virtual and no need to register routes in IIS. So now I know why Dynamics CRM is using it. Using routing client doesn’t need to specify Organization name for each method call of WCF service. While creating client object, URL itself gives that info. Client only needs to do this once and all methods are now aware of Organization name for particular WCF call.

此示例可以帮助您开始使用WCF的URL路由-< a href = http://msdn.microsoft.com/en-us/library/ee662952.aspx rel = nofollow> http://msdn.microsoft.com/en-us/library/ee662952.aspx

This example can help get you started with URL routing for WCF - http://msdn.microsoft.com/en-us/library/ee662952.aspx

希望这对某人有帮助!
-尼罗河

Hope this helps someone! -Nilesh

这篇关于使用URL重定向代替WCF服务的输入参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆