You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's talk about the elephant in the room: references in SOAP documents. We can generate the greatest type declarations ever, but that won't do us any good in the face of documents such as this:
ugh. What's worse, one of the explicit reasons listed in the SOAP spec for references is to support data models that include loops. A loop would cause some problems if we simply tried to flatten a document.
A long time ago I wrote a tiny package that took the "flattening" approach: aqwari.net/exp/soap. That's one approach.
Should I bundle flattening code with the generated code for wsdlgen? Seems a little heavy.
Make a package to handle the references? I like that today, code generated by xsdgen and wsdlgen has no dependencies outside of the stdlib.
What I am leaning towards is developing a standalone package that users can choose to add to their generated packages if they know they're going to be dealing with references. Something that wraps an xml.Decoder and decodes a document as if it were flattened (while still handling loops in a sane way if possible). That package should have more stringent release engineering/compatibility guarantees, since it will be imported in users' code. But I haven't started this package, so I'm keeping an issue here so I don't forget.
The text was updated successfully, but these errors were encountered:
I started work on the multiref branch, but unfortunately I am not close to resolving this issue, and will have limited time to make progress for the next month or so.
If your inputs do not contain loops, you cloud get this package to work using the "flattening" approach:
Read the whole input into a []byte
Use a package like aqwari.net/exp/soap to replace any multi refs with their content, or write your own routine to do this.
Turn the []byte back into an io.Reader using bytes.NewReader or similar and pretend nothing ever happened :)
Let's talk about the elephant in the room: references in SOAP documents. We can generate the greatest type declarations ever, but that won't do us any good in the face of documents such as this:
ugh. What's worse, one of the explicit reasons listed in the SOAP spec for references is to support data models that include loops. A loop would cause some problems if we simply tried to flatten a document.
A long time ago I wrote a tiny package that took the "flattening" approach:
aqwari.net/exp/soap
. That's one approach.What I am leaning towards is developing a standalone package that users can choose to add to their generated packages if they know they're going to be dealing with references. Something that wraps an
xml.Decoder
and decodes a document as if it were flattened (while still handling loops in a sane way if possible). That package should have more stringent release engineering/compatibility guarantees, since it will be imported in users' code. But I haven't started this package, so I'm keeping an issue here so I don't forget.The text was updated successfully, but these errors were encountered: