English 中文(简体)
多基底语
原标题:MultipleBaseAddressBasicHttpBindingServiceHostFactory or WebScriptServiceHostFactory for SharePoint 2010 Web Service?
最佳回答

这是一个伟大的问题。 我的好奇终于走到了我更好的位置,我开始 around光。 它不是权威性的最后答案,但我认为你对我所了解的内容感兴趣。

第一版:<代码>MultipleBaseAddressBasicHttpBledserviceHostFactory 简单地生成<条码>MultiBaseAddressBasicHttpBledserviceHost物体;<条码> 简单地生成<代码>WebSER.Host物体。

两个东道国都继承了<代码>System.serviceModel.serviceHost,因此它们具有共同点的健康基础。 对我们来说,这减少了我们必须检查的法典足迹,以便进行公平的比较。

现在,虽然每类法律没有多少新法,但它们迅速分出不同方向。 查阅OnOpening( implementations。

www.un.org/Depts/DGACM/index_spanish.htm 我们:

base.OnOpening();
WebServiceHost.AddAutomaticWebHttpBindingEndpoints(
    this,
    base.ImplementedContracts,
    SR2.GetString(SR2.JsonWebScriptServiceHostOneServiceContract, base.ImplementedContracts.Count));
foreach (ServiceEndpoint endpoint in base.Description.Endpoints)
{
    if (endpoint.Binding != null &&
        endpoint.Binding.CreateBindingElements().Find<WebMessageEncodingBindingElement>() != null &&
        endpoint.Behaviors.Find<WebHttpBehavior>() == null)
    {
        endpoint.Behaviors.Add(new WebScriptEnablingBehavior());
    }
}

除非我犯错,否则,你想要的行文读物(>endpoint.Behaviors.Add(新网络版,EnablingBehavior());/js)。

现在,在<代码>MultipleBaseAddressBasicHttpBledserviceHost上,我们(已缩略):

ClientServiceHost host = ClientServiceHost.CreateServiceHost();
this.CreateEndpoints();
base.OnOpening();
host.OnServiceHostOpeningInternal(this);

。 我的印象是,共享点东道方对不同的认证模式提供了更多的自动配置支持。

ClientserviceHost.CreateserviceHost(),是一种工厂方法,根据网络所列类型创建ClientserviceHost

《服务编码》(<>HostOpening Internal()方法简单地向东道方发出电话)。 查阅网站。 安装一个违约装置,我们发现装配有服务东道国的合格名称。

<serverRuntime>
  <hostTypes>
    <add type="Microsoft.SharePoint.Client.SPClientServiceHost, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
  </hostTypes>
</serverRuntime>

这里有意思。 <OnserviceHostOpening(>) 方法如下:

[SharePointPermission(SecurityAction.Demand, ObjectModel=true)]
protected override void OnServiceHostOpening(ServiceHost serviceHost)
{
    if (serviceHost != null)
    {
        SPUtility.ConfigServiceHostIfClaimsAuth(serviceHost);
    }
}

更进一步,我们看到围绕将一个基于要求认证的东道方组合起来的逻辑仪表体。

Aha! 值得一提的差异。 Unless I m misn, there was no claim-based accreditation support in 网址:Host

Conclusion

也许你不使用基于索偿的认证。 如果是,你可能会发现使用<代码>。 网上文本服务(Host)罚款。 然而,如果我写这本书,我会创建新的东道和东道工厂,继承Microsoft的类型,并且看我是否能够通过<代码>endpoint.Behaviors创建展期。 添加(新网络文本EnablingBehavior()。 可能发生的最坏事情是,它将不工作。 另一方面,如果工作,你可以期望有一个高度兼容的服务东道国工厂,支持你的最终选择。

我希望这一帮助。

问题回答

暂无回答




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签