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

Allow non-qualified XML serialization when XML namespaces are part of the metadata #413

Closed
holtkamp opened this issue Mar 11, 2015 · 1 comment

Comments

@holtkamp
Copy link
Contributor

Currently, when an XML namespace is defined in the metadata, serialization results in qualified XML elements (read: with namespaces). This seems logical and is implemented in code like this: https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/XmlSerializationVisitor.php#L287

However, sometimes qualified XML is not allowed to be used by certain web services. Do not ask me why, but some developers choose to NOT allow qualified XML elements in requests, for example in this WSDL, note the elementFormDefault="unqualified". I don't understand why to use namespaces in the first place, when not allowing them, but ok, that is reality.

One approach would be to strip all the XML namespace definitions from my metadata files. A more elegant way would be to instruct the serializer to ignore these XML namespaces during serialization.

It seems this kind of 'configuring' the serializer is currently not possible. What would be a nice approach to realize this? Maybe by setting a boolean flag 'useXmlNamespace' in the Context that is handed over to the serializer?

@goetas
Copy link
Collaborator

goetas commented Apr 25, 2017

One approach would be to strip all the XML namespace definitions from my metadata files

Sorry for the long feedback loop. Probably you have already solved the issue, but yes, I suggest to play with metadata files and to adapt them to what they require

@goetas goetas closed this as completed Apr 25, 2017
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

No branches or pull requests

2 participants