-
Notifications
You must be signed in to change notification settings - Fork 379
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
Issue With Data Types when using XmlSerializer #959
Comments
That seems very odd. When I generate a client for my own legacy service, also in Visual studio, strings are strings. I don't have any byte arrays so I can't be sure about that one. In my experience existing clients can work fine even though a newly generated one is wonky. But this is unlike anything I've encountered. Are you using a custom wsdl? From one of my own generated classes (Reference.cs)
|
I use the overload of UseSoapEndpoint that accepts a SoapCoreOptions, but I find it hard to believe that this should affect the client generation in Visual studio |
I have made a minimal reproduction and it appears that the reason that this is caused was from an XmlElement attribute on the objects
Once these are removed the data types on the client are correctly byte[] and string |
Ah! Then there is most likely a bug in there somewhere. XmlElement has a Type-property that you can probably use to be able to use XmlElement |
…t C# sees as enumerable. They should not be unbounded in the wsdl since that would cause clients to generate byte[] as byte[][] etc. fixes DigDes#959
Could you pull my fork https://github.com/andersjonsson/SoapCore/tree/fix-wsdl-error-for-string-and-bytearray and test this against your service to see if it works? |
Thank you for finding the fix to that issue - I have been able to test and verify that this has worked successfully. I have found one other issue with the xml serializer that I missed previously because of this issue which I assume is unrelated I have tried supplying the type of Guid as part of thexml element, however with or without this addition when the a new service refrence is added in visual studio the type is always guid. On the old wsdl the type was successfully set as xs:guid.
and while this did output type xsd:guid on the wsdl, when a new reference was added it was typed as string not guid
Is this something you might be able to help with? |
As far as I can tell Guid is not part of the types that are supported by Soap. Please open a new issue, since this one i resolved, and include relevant parts of your old and new wsdl and I'll try to investigate |
Hi All,
We are using XmlSerializer and an old version of SoapCore(v1.1.0.9) as below to create our soap service, however when we add a reference to this on visual studio the object definitions appear malformed.
Some examples are byte[] File and string FileName properties end up on the client side as byte[][] File and string[] FileName respectively.
Additionally I have updated to the latest version of SoapCore (v.1.1.0.38) with the startup and have this same issue.
An example of the reference.cs that is generated by visual studio:
Is there something that can be done to prevent this from happening while still using the XmlSerializer?
It is important to us that we don't break compatibility for existing Web Services clients.
All help is greatly appreciated.
The text was updated successfully, but these errors were encountered: