jsgoupil / quickbooks-sync

Sync Quickbooks Desktop
MIT License
89 stars 40 forks source link

SoapCore 0.9.9 is not compatible with .NET core 3.1 #41

Closed jsgoupil closed 4 years ago

jsgoupil commented 4 years ago

https://github.com/DigDes/SoapCore/issues/373

TypeLoadException: Could not load type 'Microsoft.AspNetCore.Http.Internal.BufferingHelper' from assembly 'Microsoft.AspNetCore.Http, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

Need to update SoapCore. But they way they do not support .NET Core 2.2.

Upgrading to 1.0.0 should work.

tofer commented 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.

jsgoupil commented 4 years ago

Thanks @tofer I worked way too long today to understand what I'm doing right now :P So will continue soon and update accordingly!

jsgoupil commented 4 years ago

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)