I assume you have control over the WS Server Side as well, if you do and you
just want ns2 to be replaced with ns1 in your case you need to put this in
your applicationContext.xml:
<jaxws:endpoint
...>
<jaxws:dataBinding>
<bean class="org.apache.cxf.jaxb.JAXBDataBinding">
<property name="namespaceMap">
<map>
<entry>
<key><value>http://test.ws.com/</value></key>
<value>ns1</value>
</entry>
</map>
</property>
</bean>
</jaxws:dataBinding>
</jaxws:endpoint>
But as Freeman mentioned your client is a bit weird, since any name space
prefixes are valid as long as they are mapped:
xmlns:ns2="http://test.ws.com/" in the envelope or are part of node's
attibute, in your case: <ns2:getMessageResponse
xmlns:ns2="http://test.ws.com/">. So your client shouldn't have any problem
in resolving ns2. NS1, NS2 are just short notations for the full namespace
added by JAXB in order not to use the full namespace allover the places
where namespace reference is needed.
This being said, you'd probably want instead of tweaking the Web Service
Server side solve problem with your client, otherwise you might end up
fixing problems for one "weird" client and break things for many other
properly implemented clients using same Web Service Server.
--
View this message in context:
http://cxf.547215.n5.nabble.com/Namespace-prefix-ns1-is-missing-in-cxf-soap-response-tp5732560p5737112.html
Sent from the cxf-user mailing list archive at Nabble.com.