cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Shakirin <ashaki...@talend.com>
Subject RE: cxf org.apache.cxf.feature.StaxTransformFeature outTransformElements does not work
Date Fri, 12 Oct 2012 12:33:14 GMT
Hi,

Just re-tested in my environment, it works without problem.

I receive response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:subscribeServCfmResponse xmlns:ns2="http://www.chinamobile.com/vgop/serviceorder/v1_0">
         <ns2:subscribeServCfmResp>
            <result>0</result>
         </ns2:subscribeServCfmResp>
      </ns2:subscribeServCfmResponse>
   </soap:Body>
</soap:Envelope>

from original response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>
<ns2:subscribeServCfmReq xmlns:ns2="http://www.chinamobile.com/vgop/serviceorder/v1_0">
<return><result>0</result></return></ns2:subscribeServCfmReq></soap:Body></soap:Envelope>


"result" element was replaced.
Could you also provide spring configuration for the service endpoint?

Two other points:
1) Response in your mail was not well-formed, double quotas are missing for the namespace:
<ns2:subscribeServCfmResponse xmlns:ns2=http://www.chinamobile.com/vgop/serviceorder/v1_0>.

Not sure is that just typo error.

2) I find fragile to replace element with predefined prefix: 
             <entry key="return" value="ns2:subscribeServCfmResp" />

If new namespace will be added, prefix ns2 can point on another namespace or be undefined.

The safer was is to replace element wit namespace:
             <entry key="return" value="="{http://www.chinamobile.com/vgop/serviceorder/v1_0}subscribeServCfmResp"
/>

Regards,
Andrei.

-----Original Message-----
From: cantalou89 [mailto:cantalou89@gmail.com] 
Sent: Freitag, 12. Oktober 2012 04:29
To: users
Subject: cxf org.apache.cxf.feature.StaxTransformFeature outTransformElements does not work

dear all:
i use cxf2.6.2 to public webservice , now i want to replace elememt , it works fine in inTransformElements
, but outTransformElements was not.
the configuration:
<bean id="transformFeature" class="org.apache.cxf.feature.StaxTransformFeature">
    <property name="inTransformElements">
       <map>
           <entry key="{http://www.chinamobile.com/vgop/serviceorder/v1_0}subscribeServCfmReq"
value="subscribeServCfmReq" />
       </map>
   </property>
   <property name="outTransformElements">
         <map>
             <entry key="return" value="ns2:subscribeServCfmResp" />
         </map>
</property>
</bean>
but client receive a message like that:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>
<ns2:subscribeServCfmResponse xmlns:ns2=http://www.chinamobile.com/vgop/serviceorder/v1_0>
<return><result>0</result></return></ns2:subscribeServCfmResponse></soap:Body></soap:Envelope>


the outTransformElements is not work , is it the configuration correct ? or there is another
way to do this thanks 




cantalou89

Mime
View raw message