这一篇,我们看一下.net core如何创建WebService,首先创建一个.net core的web应用。
项目创建好以后,需要通过NuGet加入SoapCore
新建一个类,用于返回和接收参数
[
[
报错信息:
FaultException:The maxinum string content length quota(8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader .Line 1,position135
解决:在.net Core项目中startup.cs文件的Configure方法中
var binging = new BasicHttpBinding();
binging.ReaderQuotas.MaxStringContentLength = int.MaxValue;
app.UseSoapEndpoint<IContract>("/StudentService.asmx", binging, SoapSerializer.XmlSerializer);