简体   繁体   English

将soap服务(.asmx)与Azure Service结构一起使用

[英]Using soap services(.asmx) with Azure Service fabric

I am migrating my existing services to Azure service fabric. 我正在将现有服务迁移到Azure服务结构。 My existing application support the soap service(asmx) for the legacy users. 我现有的应用程序支持旧版用户的soap服务(asmx)。 I want to use the same web service as part of my microservice. 我想使用相同的Web服务作为我的微服务的一部分。 That web service test.asmx(say) can be called from Rest Apis as well(If soln is there). 那个web服务test.asmx(比如说)也可以从Rest Apis调用(如果soln在那里)。 But I'm not finding any way to use the soap service as part of Azure service fabric microservice approach. 但我没有找到任何方法使用soap服务作为Azure服务结构微服务方法的一部分。 Help me out of possible solutions for tackling the web service scenario. 帮助我找出解决Web服务方案的可能解决方案。 Thanks! 谢谢!

I recommend converting your ASMX service into a WCF service with a BasicHttpBinding. 我建议使用BasicHttpBinding ASMX服务转换为WCF服务。 You can then host your WCF service inside a stateless SF service, like shown here . 然后,您可以托管WCF服务的无国籍SF服务中,像显示在这里

private static ICommunicationListener CreateRestListener(StatelessServiceContext context)
{
   string host = context.NodeContext.IPAddressOrFQDN;
   var endpointConfig = context.CodePackageActivationContext.GetEndpoint("CalculatorEndpoint");
   int port = endpointConfig.Port;
   string scheme = endpointConfig.Protocol.ToString();
   string uri = string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}/", scheme, host, port);
   var listener = new WcfCommunicationListener<ICalculatorService>(
                    serviceContext: context,
                    wcfServiceObject: new WcfCalculatorService(),
                    listenerBinding: new BasicHttpBinding(BasicHttpSecurityMode.None),
                    address: new EndpointAddress(uri)
   );
   return listener;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM