Namespaces in reponse message


I have created a provider webservice on the IS which is called by an external consumer.
The WSDL file imports an XSD schema which contains the request and response message types. This XSD schema imports several other XSD schemas as well. So, there are several namespaces defined.

What I see now is that for each element in the reponse soap message, the namespace is defined again. Which leads to a serious increase of message size.

This is how my reponse message looks like:

<soapenv:Envelope xmlns:soapenv="">
      <msg:getInformationResponse xmlns:msg="">
            <contact:IDNumber xmlns:contact="">2132434</contact:IDNumber>
            <contact:name xmlns:contact="">A</contact:name>
            <contact:lastname xmlns:contact="">B</contact:lastname>
            <contact:street xmlns:contact="">C</contact:street>
            <contact:houseNumber xmlns:contact="">D</contact:houseNumber>
            <contact:zipcode xmlns:contact="">E</contact:zipcode>
            <contact:codeTypeDeclaration xmlns:contact="">zfsfsd</contact:codeTypeDeclaration>
            <contact:dateDeDeclaration xmlns:contact="">qsdqsdq</contact:dateDeDeclaration>
            <agreement:codeDomain xmlns:agreement="">DFDF</agreement:codeDomain>
            <agreement:date xmlns:agreement="">DFDSFDS</agreement:date>
            <agreement:flag xmlns:agreement="">TRUE</agreement:flag>

Does anyone have a solution to remove the unnecessary namespace declarations?
Many thanks!


you can specify the nsdecls param when you convert from XML document to String parsing…that should take care of the response string handling the name space for the documentTypeName you are outputting.

Is that what you are looking?