On Oct 15, 2012, at 7:42 AM, Aki Yoshida <[email protected]> wrote:

> I don't know why the ns2 prefix binding for those elements is removed.
> I'll look into it this afternoon.

Can you try with 2.6.3?  We did fix a couple of things related to dropped 
namespaces for 2.6.3:


commit 6993f39bccea4ed126debf88c8fdd842d00b4750
Author: Daniel Kulp <[email protected]>
Date:   Fri Sep 28 15:48:52 2012 +0000

    Per javadoc, empty prefix needs to delgate to writeDefaultNamespace
    
    git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1391510 
13f79535-47bb-0310-9956-ffa450edef68

commit 65aed4a841de14f1a7caec6fd1f0ebc28b79245b
Author: Akitoshi Yoshida <[email protected]>
Date:   Thu Sep 13 15:17:46 2012 +0000

    [CXF-4503] TransformOutInterceptor may lose namespace declarations in some 
elements
    
    git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1384365 
13f79535-47bb-0310-9956-ffa450edef68



Dan



> 
> 2012/10/15 Sergey Beryozkin <[email protected]>:
>> Hi
>> 
>> On 14/10/12 16:57, cantalou89 wrote:
>>> 
>>> Hi all,
>>> I encounter a problem when I used cxf 2.6.2 .
>>> I used StaxTransformFeature with configuration '<entry
>>> key="{http://www.chinamobile.com/vgop/serviceorder/v1_0}result";
>>> value="result" />' to remove result element's namespace befor the soap
>>> message responsed to client. Althought the result element's namespace has
>>> removed , but the namespace description
>>> xmlns:ns2="http://www.chinamobile.com/vgop/serviceorder/v1_0
>>> of<ns2:subscribeServCfmResponse>  also has been removed, it is not what i
>>> want . I just want to replce<ns2:result>  of<result>  , so how could i do?
>>> Thanks .
>>> 
>>> The spring configuration below:
>>> <jaxws:endpoint id="UserOrderServer" address="/UserOrderServer.jws"
>>> implementor="com.funo.ehealth.ws.UserOrderServerImpl">
>>> 
>>>   <jaxws:outInterceptors>
>>>     <bean name="useForStaxTransformFeature"
>>> class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"></bean>
>>>   </jaxws:outInterceptors>
>>> 
>>>   <jaxws:features>
>>>    <bean class="org.apache.cxf.feature.LoggingFeature" />
>>>    <bean id="transformFeature"
>>> class="org.apache.cxf.feature.StaxTransformFeature">
>>>      <property name="outTransformElements">
>>>        <map>
>>>         <entry
>>> key="{http://www.chinamobile.com/vgop/serviceorder/v1_0}result";
>>> value="result" />
>>>        </map>
>>>      </property>
>>>     </bean>
>>>   </jaxws:features>
>>> </jaxws:endpoint>
>>> 
>>> Before I enable the StaxTransformFeature , the clien received a soap
>>> message like below:
>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>>>  <soap:Header/>
>>>   <soap:Body>
>>>     <ns2:subscribeServCfmResponse
>>> xmlns="http://www.chinamobile.com/vgop/serviceorder/v1_0/common";
>>> xmlns:ns2="http://www.chinamobile.com/vgop/serviceorder/v1_0";>
>>>      <ns2:SubscribeServCfmResp>
>>>       <ns2:result>0</ns2:result>
>>>      </ns2:SubscribeServCfmResp>
>>>    </ns2:subscribeServCfmResponse>
>>>   </soap:Body>
>>> </soap:Envelope>
>>> 
>>> AfterI enable the StaxTransformFeature , the clien received a soap message
>>> like below:
>>> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>>>  <soap:Header/>
>>>   <soap:Body>
>>>     <ns2:subscribeServCfmResponse
>>> xmlns="http://www.chinamobile.com/vgop/serviceorder/v1_0/common";>
>>>      <ns2:SubscribeServCfmResp>
>>>       <result>0</result>
>>>      </ns2:SubscribeServCfmResp>
>>>    </ns2:subscribeServCfmResponse>
>>>   </soap:Body>
>>> </soap:Envelope>
>>> 
>> 
>> It looks like a bug, at the moment the feature tries to avoid the
>> 'left-over' prefixes leaking into the transformed representations (as often
>> no traces of the 'old' namespace are expected), but in this case it breaks
>> it.
>> 
>> Can you have something like
>> 
>> 
>> <map>
>>      <entry key="{http://www.chinamobile.com/vgop/serviceorder/v1_0}result";
>> value="result" />
>>      <entry
>> key="{http://www.chinamobile.com/vgop/serviceorder/v1_0}subscribeServCfmResponse";
>> value="{http://www.chinamobile.com/vgop/serviceorder/v1_0}subscribeServCfmResponse";
>> />
>> </map>
>> 
>> and check if it helps to retain this specific namespace ? If not then we
>> will introduce a property for the namespace declarations be optionally
>> retained
>> 
>> Sergey
>> 
>>> 
>>> 
>>> 
>>> cantalou89
>> 
>> 
>> 
>> --
>> Sergey Beryozkin
>> 
>> Talend Community Coders
>> http://coders.talend.com/
>> 
>> Blog: http://sberyozkin.blogspot.com

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to