Using soap services (.asmx) using Azure Service technology
I am migrating my existing services to an Azure service center. My existing application supports a soap service (asmx) for legacy users. I want to use the same web service as part of my microservice. This webservice test.asmx (say) can also be called from Rest Apis (if there is soln). But I don't find any way to use the soap service as part of the Azure service microservice approach. Help me work out the possible solutions for the web service script. Thank!
+3
source to share
1 answer
I recommend converting your ASMX service to a WCF service using BasicHttpBinding. Then you can host your WCF service inside a stateless SFTP service like here .
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;
}
+4
source to share