Closed jsgoupil closed 4 years ago
Just FYI, my application is .Net Core 3.0, and I had to use SoapCore 1.0.0-alpha to make this work. Nice to see it's out of alpha.
I don't think the app.UseSoapEndpoint<EndPoint>(options.SoapPath, new BasicHttpBinding(), SoapSerializer.XmlSerializer);
worked anymore though, as looking at my application I have this:
app.UseEndpoints(endpoints =>
{
// In the QbSync.WebConnector.AspNetCore NuGet package, this was 'app.UseWebConnector'
endpoints.UseSoapEndpoint<IQbManager>("/your/web/connector/endpoint", new SoapEncoderOptions()
{
ReaderQuotas = new XmlDictionaryReaderQuotas
{
MaxStringContentLength = 65_536
},
WriteEncoding = Encoding.UTF8,
MessageVersion = MessageVersion.Soap11
}, SoapSerializer.XmlSerializer);
endpoints.MapControllers();
});
In case that helps.
Thanks @tofer I worked way too long today to understand what I'm doing right now :P So will continue soon and update accordingly!
We had a little chat trying to figure out this MaxStringContentLength And without a proper value, we get this message:
SoapCore.SoapEndpointMiddleware: Warning: There is an error in XML document (1, 284).
System.InvalidOperationException: There is an error in XML document (1, 284).
---> System.Xml.XmlException: The maximum 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, position 284.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
https://github.com/DigDes/SoapCore/issues/373
Need to update SoapCore. But they way they do not support .NET Core 2.2.
Upgrading to 1.0.0 should work.