本文介绍了什么办法让OWIN举办一个SOAP服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得OWIN举办一个SOAP端点(不在乎是否WCF是或不参与,SOAP提供了WSDL使服务更容易被某些客户的消费,这就是为什么我要SOAP和REST)



我怀疑的答案是:实现你自己的中间件承载SOAP端点。如果是这样的答案就这样吧,但是这是一个大量的工作,所以我可能就这样结束了WCF坚持和避免OWIN如果是这样的情况。我很难相信没有人已经实施托管中间件SOAP可是...






作为一项规则,我们喜欢两者都做REST和SOAP端点对我们的服务;目前我们使用IIS和WCF宁静位主机与 [的ServiceContract] / [OperationContract的] 属性的SOAP和剩下的就是定义的 [WebInvoke] 属性,这些属性的服务不需要重新实现了不同终端类型。



我们仅仅使用ASP.NET路由添加新的 ServiceRoute ■哪些添加其他具有相同的服务作为SOAP绑定URI / SOAP绑定到URI / REST。



现在我们正在考虑做一些新的服务工作,我想前进到使用OWIN,所以我们可以用托管不可知论一些服务实现我们的新服务将通过举办Windows服务得到更好的服务和IIS服务的托管一些更好的服务。



我所有的事情摆弄,到目前为止,我能想出没有办法得到的通过OWIN主办的SOAP端点。我剩下的由 ApiController 让我的服务继承,然后使用在OWIN应用程序的配置代码这个小片段处理精细方法:

 公共无效配置(IAppBuilder应用程序)
{
HttpConfiguration配置=新HttpConfiguration( );
config.MapHttpAttributeRoutes();
app.UseWebApi(配置);
[...]


解决方案

这不是那么容易主机通过OWIN一个WCF的基础设施,确保它可以是可能的,有一些工作很明显可以适应,或代理由于请求 - 响应层到WCF基础设施; WCF提供了一个不那么容易,但一个完整的基础设施,做这样的事情。



刚刚例如,你可以在此看一看这正是我在谈论的一到OWIN适应WCF方式来获得在它上面一个SOAP端点:



希望这有助于。


How do I get OWIN to host a SOAP endpoint (do not care if WCF is or isn't involved, SOAP gives WSDL which makes services easier to consume by certain clients, that's why I want SOAP and REST)

I suspect the answer is: Implement your own middleware that hosts a SOAP endpoint. If that's the answer so be it, but that's a lot of work so I'll probably just end up sticking with WCF and avoiding OWIN if that's the case. I find it hard to believe no one has implemented a SOAP hosting middleware yet...


As a rule we like to do both REST and SOAP endpoints on our services; currently we use IIS and the WCF restful bits to host the SOAP with [ServiceContract]/[OperationContract] attributes, and the rest is defined with [WebInvoke] attributes, with these attributes the services need no reimplementation for the different endpoint types.

We just use the ASP.NET routes to add new ServiceRoutes which add a rest binding to URI/REST with the same service as a soap binding to URI/SOAP.

Now we're looking at doing some new services work and I'd like to move forward to using OWIN so we can implement our new services with hosting agnosticism as some services will be better served by windows service hosting and some better served by IIS service hosting.

All of my fiddling with things and so far I can come up with no way of getting a SOAP endpoint hosted by OWIN. I have the rest handled fine by making my service inherit from ApiController and then using this little snippet of code in the OWIN app's Configuration method:

    public void Configuration(IAppBuilder app)
    {
        HttpConfiguration config = new HttpConfiguration();
        config.MapHttpAttributeRoutes();
        app.UseWebApi(config);
        [...]
解决方案

It's not so easy to host a WCF infrastructure over an OWIN one, sure it can be possible, with a bit of work it's clear possible to adapt, or proxy the owing request-response layer to the WCF infrastructure; WCF provides a not so easy but a complete infrastructure to do something like that.

Just for example you can take a look at this which is just what I was talking about as a way to adapt OWIN to WCF to get a SOAP endpoint on top of it: Owin WCF HOST

Hope this help.

这篇关于什么办法让OWIN举办一个SOAP服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 08:20