I have seen a lot of support requests recently asking about setting default namespaces and the like. As a result, I will be introducing some changes to the API that I believe makes this task much more intuitive. Of course, changing the API should not be done lightly, especially to a subroutine like uri which is used by every installation of SOAP::Lite on the planet - one way or another. So it will be slowly phased out. So what are these changes, you ask?
First, there are two new subroutines added to SOAP::Serializer and also made available through SOAP::Lite as a shortcut, they are: default_ns() and ns(). They set the namespace URI of a request while at the same time express how that namespace should be serialized - either as a default namespace or as a declared namespace. Second, to provide a more intuitive name, use_prefix is being deprecated in favor of one of the aforementioned subroutines. Finally, uri() is also being deprecated for similar reasons. It's name never did make that much sense to me, and I am hoping that ns() is more intuitive.
Keep reading to see the man page entries for these new subroutines.
default_ns(). Setting the default namespace causes elements to be serialized without a namespace prefix, like so:
default_ns(). If a prefix is not specified, one will be generated for you automatically. Setting the namespace causes elements to be serialized with a namespace prefix, like so: