Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateOnly throws .NET type DateOnly cannot be resolved into XML schema type #793

Closed
kobruleht opened this issue Dec 29, 2021 · 2 comments · Fixed by #800
Closed

DateOnly throws .NET type DateOnly cannot be resolved into XML schema type #793

kobruleht opened this issue Dec 29, 2021 · 2 comments · Fixed by #800

Comments

@kobruleht
Copy link

Trying to use .NET 6 DateOnly datatype throws exception

System.ArgumentException: .NET type DateOnly cannot be resolved into XML schema type
SoapCore.Meta.MetaBodyWriter.ResolveType(Type type)
at SoapCore.Meta.MetaBodyWriter.AddSchemaType(XmlDictionaryWriter writer, TypeToBuild toBuild, String name, Boolean isArray, String namespace, Boolean isAttribute, Boolean isListWithoutWrapper, Boolean isUnqualified)
at SoapCore.Meta.MetaBodyWriter.AddSchemaTypePropertyOrField(XmlDictionaryWriter writer, MemberInfo member, TypeToBuild parentTypeToBuild)
at SoapCore.Meta.MetaBodyWriter.AddSchemaComplexType(XmlDictionaryWriter writer, TypeToBuild toBuild)
at SoapCore.Meta.MetaBodyWriter.AddTypes(XmlDictionaryWriter writer)
at SoapCore.Meta.MetaBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)
at SoapCore.MessageEncoder.SoapMessageEncoder.WriteMessageAsync(Message message, PipeWriter pipeWriter)
at SoapCore.SoapEndpointMiddleware`1.ProcessMeta(HttpContext httpContext)
at SoapCore.SoapEndpointMiddleware`1.Invoke(HttpContext httpContext, IServiceProvider serviceProvider)

@andersjonsson
Copy link
Collaborator

Yup. I can see that there is no case for DateOnly in the ClrTypeResolver.
https://github.com/DigDes/SoapCore/blob/develop/src/SoapCore/Meta/ClrTypeResolver.cs

Care to add one and submit a PR?

Full disclosure: I'm not a project maintainer. Just a user/contributor trying to help other users to contribute. That way we can all help to move this project forward.

@kobruleht
Copy link
Author

I dont know the internals on SoapCore to properly implement this. However it looks like the patch would be trivial. Maybe someone with commit rights adds this and publishes new nuget package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants