We used a WSDL and generated an Apex class from that WSDL. Since there were multiple namespaces in the WSDL, we gave a common class name. (as recommended in SFDC) Once the Apex class was generated it had the correct namespaces as expected.However when we try to invoke a backend billing system by generating a request XML using this class, we do not get the namespaces as expected.
Example: in our case all elements have different namespaces inside the same request XML. However there is no namespace generated to the elements in the request rather a namespace generated for the request message. This is incorrect as we need to a correct namespace mentioned for every element and in fact in APEX class its generated correctly as well.