从Soap Response Camel CXF中删除名称空间 [英] Removing namespace from Soap Response Camel CXF
问题描述
以下是我对骆驼cxf中托管的服务的示例肥皂响应
Below is my sample Soap Response for a service hosted in camel cxf
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:XpgIntegratedPaymentResponse xmlns:ns2="http://test:9090/wsx/services/WemXpgPaymentService"/>
</soap:Body>
</soap:Envelope>
现在我不想在响应中生成 ns2命名空间前缀。
Now I don't want to generate "ns2" namespace prefix in response.
有人可以帮忙吗?
推荐答案
如果要删除该元素的名称空间,它将其序列化为没有命名空间的XpgIntegratedPaymentResponse,常见的方法是使用CXF的转换功能。
if you want to drop the namespace of that element so that it is serialized as no-namespaced XpgIntegratedPaymentResponse, the common approach is to use CXF's transform feature.
see more info here: http://cxf.apache.org/docs/transformationfeature.html#TransformationFeature-Changinginputandoutputelementnamesandnamespaces
在您的特定情况下,您需要输入以下内容
in your particular case, you will need the following entry
<输入密钥= { http:// test:9090 / wsx / services / WemXpgPaymentService } XpgIntegratedPaymentResponse
value = XpgIntegratedPaymentResponse />
<entry key="{http://test:9090/wsx/services/WemXpgPaymentService"}XpgIntegratedPaymentResponse" value="XpgIntegratedPaymentResponse"/>
这篇关于从Soap Response Camel CXF中删除名称空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!