1、d Bridge.WmsService.Host 、Bridge.Wms.HttpApi中引用soapcore
2、WmsServiceHostModule中注入服务
ConfigureServices方法中
//注入WebService context.Services.AddSoapCore();
OnApplicationInitialization方法中
app.UseSoapEndpoint<IOrderWebService>("/OrderWebService.asmx", new SoapEncoderOptions(), SoapSerializer.XmlSerializer);
3、开发对应的接口和实现类
接口类IOrderWebService
[ServiceContract] public interface IOrderWebService { [OperationContract] Task<string> CreateOrderList(string xml); [OperationContract] Task<OrderOutput> GetOrderList(OrderXmlInput input); }
实现类OrderWebService
public class OrderWebService : IOrderWebService, ITransientDependency { public Task<string> CreateOrderList(string xml) { return Task.FromResult("操作成功"); } public Task<OrderOutput> GetOrderList(OrderXmlInput input) { var dto = new OrderOutput() { VoucherCode = input.VoucherCode, SupplierName = "test" }; return Task.FromResult(dto); } }
4、postman调用成功
标签:VNext,Task,webservice,IOrderWebService,---,OrderWebService,input,public From: https://www.cnblogs.com/zhengwei-cq/p/18597703