cxf框架做的服务端接收请求并响应。

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"><soap:Body xmlns="http://www.example.org/stock"><GetStockPriceResponse><Price>34.5</m:Price></GetStockPriceResponse></soap:Body>
</soap:Envelope>

希望得到的返回应该是:

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"><soap:Body xmlns:m="http://www.example.org/stock"><m:GetStockPriceResponse><m:Price>34.5</m:Price></m:GetStockPriceResponse></soap:Body>
</soap:Envelope>

找了很久,最后在自动生成的ObjectFactory文件中解决了。

将第367行 namespace 里面设为“”即可。

  1 package com.haiyisoft.hyoms.wbs.pubMVFault;
  2
  3 import javax.xml.bind.JAXBElement;
  4 import javax.xml.bind.annotation.XmlElementDecl;
  5 import javax.xml.bind.annotation.XmlRegistry;
  6 import javax.xml.namespace.QName;
  7
  8
  9 /**
 10  * This object contains factory methods for each
 11  * Java content interface and Java element interface
 12  * generated in the com.haiyisoft.hyoms.wbs.pubMVFault package.
 13  * <p>An ObjectFactory allows you to programatically
 14  * construct new instances of the Java representation
 15  * for XML content. The Java representation of XML
 16  * content can consist of schema derived interfaces
 17  * and classes representing the binding of schema
 18  * type definitions, element declarations and model
 19  * groups.  Factory methods for each of these are
 20  * provided in this class.
 21  *
 22  */
 23 @XmlRegistry
 24 public class ObjectFactory {
 25
 26     private final static QName _PublishMVFaultRepairWorkResponse_QNAME = new QName("http://pdjyh.soa.csg.cn", "PublishMVFaultRepairWorkResponse");
 27     private final static QName _EventMessage_QNAME = new QName("http://pdjyh.soa.csg.cn", "EventMessage");
 28     private final static QName _PublishMVFaultRepairWorkRequest_QNAME = new QName("http://pdjyh.soa.csg.cn", "PublishMVFaultRepairWorkRequest");
 29     private final static QName _RequestMessage_QNAME = new QName("http://pdjyh.soa.csg.cn", "RequestMessage");
 30     private final static QName _ResponseMessage_QNAME = new QName("http://pdjyh.soa.csg.cn", "ResponseMessage");
 31
 32     /**
 33      * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.haiyisoft.hyoms.wbs.pubMVFault
 34      *
 35      */
 36     public ObjectFactory() {
 37     }
 38
 39     /**
 40      * Create an instance of {@link ObjQueryParam }
 41      *
 42      */
 43     public ObjQueryParam createObjQueryParam() {
 44         return new ObjQueryParam();
 45     }
 46
 47     /**
 48      * Create an instance of {@link PublishMVFaultRepairWorkResponseType }
 49      *
 50      */
 51     public PublishMVFaultRepairWorkResponseType createPublishMVFaultRepairWorkResponseType() {
 52         return new PublishMVFaultRepairWorkResponseType();
 53     }
 54
 55     /**
 56      * Create an instance of {@link EventMessageType }
 57      *
 58      */
 59     public EventMessageType createEventMessageType() {
 60         return new EventMessageType();
 61     }
 62
 63     /**
 64      * Create an instance of {@link PublishMVFaultRepairWorkRequestType }
 65      *
 66      */
 67     public PublishMVFaultRepairWorkRequestType createPublishMVFaultRepairWorkRequestType() {
 68         return new PublishMVFaultRepairWorkRequestType();
 69     }
 70
 71     /**
 72      * Create an instance of {@link RequestMessageType }
 73      *
 74      */
 75     public RequestMessageType createRequestMessageType() {
 76         return new RequestMessageType();
 77     }
 78
 79     /**
 80      * Create an instance of {@link ResponseMessageType }
 81      *
 82      */
 83     public ResponseMessageType createResponseMessageType() {
 84         return new ResponseMessageType();
 85     }
 86
 87     /**
 88      * Create an instance of {@link ErrorType }
 89      *
 90      */
 91     public ErrorType createErrorType() {
 92         return new ErrorType();
 93     }
 94
 95     /**
 96      * Create an instance of {@link Substation }
 97      *
 98      */
 99     public Substation createSubstation() {
100         return new Substation();
101     }
102
103     /**
104      * Create an instance of {@link Operation }
105      *
106      */
107     public Operation createOperation() {
108         return new Operation();
109     }
110
111     /**
112      * Create an instance of {@link Attachment }
113      *
114      */
115     public Attachment createAttachment() {
116         return new Attachment();
117     }
118
119     /**
120      * Create an instance of {@link DispatchingTroubleTicketMirdItem }
121      *
122      */
123     public DispatchingTroubleTicketMirdItem createDispatchingTroubleTicketMirdItem() {
124         return new DispatchingTroubleTicketMirdItem();
125     }
126
127     /**
128      * Create an instance of {@link OperationSet }
129      *
130      */
131     public OperationSet createOperationSet() {
132         return new OperationSet();
133     }
134
135     /**
136      * Create an instance of {@link ErpOrganisation }
137      *
138      */
139     public ErpOrganisation createErpOrganisation() {
140         return new ErpOrganisation();
141     }
142
143     /**
144      * Create an instance of {@link MVFaultRepairWork }
145      *
146      */
147     public MVFaultRepairWork createMVFaultRepairWork() {
148         return new MVFaultRepairWork();
149     }
150
151     /**
152      * Create an instance of {@link ErpPerson }
153      *
154      */
155     public ErpPerson createErpPerson() {
156         return new ErpPerson();
157     }
158
159     /**
160      * Create an instance of {@link TroubleTicketItem }
161      *
162      */
163     public TroubleTicketItem createTroubleTicketItem() {
164         return new TroubleTicketItem();
165     }
166
167     /**
168      * Create an instance of {@link EquipmentFault }
169      *
170      */
171     public EquipmentFault createEquipmentFault() {
172         return new EquipmentFault();
173     }
174
175     /**
176      * Create an instance of {@link OptionType }
177      *
178      */
179     public OptionType createOptionType() {
180         return new OptionType();
181     }
182
183     /**
184      * Create an instance of {@link DocErpPersonRole }
185      *
186      */
187     public DocErpPersonRole createDocErpPersonRole() {
188         return new DocErpPersonRole();
189     }
190
191     /**
192      * Create an instance of {@link FaultMessageType }
193      *
194      */
195     public FaultMessageType createFaultMessageType() {
196         return new FaultMessageType();
197     }
198
199     /**
200      * Create an instance of {@link Circuit }
201      *
202      */
203     public Circuit createCircuit() {
204         return new Circuit();
205     }
206
207     /**
208      * Create an instance of {@link DocOrgRole }
209      *
210      */
211     public DocOrgRole createDocOrgRole() {
212         return new DocOrgRole();
213     }
214
215     /**
216      * Create an instance of {@link Equipment }
217      *
218      */
219     public Equipment createEquipment() {
220         return new Equipment();
221     }
222
223     /**
224      * Create an instance of {@link FaultCode }
225      *
226      */
227     public FaultCode createFaultCode() {
228         return new FaultCode();
229     }
230
231     /**
232      * Create an instance of {@link SwtichingPowerSupply }
233      *
234      */
235     public SwtichingPowerSupply createSwtichingPowerSupply() {
236         return new SwtichingPowerSupply();
237     }
238
239     /**
240      * Create an instance of {@link OutageEquipment }
241      *
242      */
243     public OutageEquipment createOutageEquipment() {
244         return new OutageEquipment();
245     }
246
247     /**
248      * Create an instance of {@link DispatchingTroubleTicketMirdList }
249      *
250      */
251     public DispatchingTroubleTicketMirdList createDispatchingTroubleTicketMirdList() {
252         return new DispatchingTroubleTicketMirdList();
253     }
254
255     /**
256      * Create an instance of {@link FaultRecord }
257      *
258      */
259     public FaultRecord createFaultRecord() {
260         return new FaultRecord();
261     }
262
263     /**
264      * Create an instance of {@link ReplyType }
265      *
266      */
267     public ReplyType createReplyType() {
268         return new ReplyType();
269     }
270
271     /**
272      * Create an instance of {@link TroubleTicketList }
273      *
274      */
275     public TroubleTicketList createTroubleTicketList() {
276         return new TroubleTicketList();
277     }
278
279     /**
280      * Create an instance of {@link TroubleTicket }
281      *
282      */
283     public TroubleTicket createTroubleTicket() {
284         return new TroubleTicket();
285     }
286
287     /**
288      * Create an instance of {@link DistributionTransformer }
289      *
290      */
291     public DistributionTransformer createDistributionTransformer() {
292         return new DistributionTransformer();
293     }
294
295     /**
296      * Create an instance of {@link RequestType }
297      *
298      */
299     public RequestType createRequestType() {
300         return new RequestType();
301     }
302
303     /**
304      * Create an instance of {@link MessageProperty }
305      *
306      */
307     public MessageProperty createMessageProperty() {
308         return new MessageProperty();
309     }
310
311     /**
312      * Create an instance of {@link ObjQueryParam.MRIDs }
313      *
314      */
315     public ObjQueryParam.MRIDs createObjQueryParamMRIDs() {
316         return new ObjQueryParam.MRIDs();
317     }
318
319     /**
320      * Create an instance of {@link ObjQueryParam.Properties }
321      *
322      */
323     public ObjQueryParam.Properties createObjQueryParamProperties() {
324         return new ObjQueryParam.Properties();
325     }
326
327     /**
328      * Create an instance of {@link JAXBElement }{@code <}{@link PublishMVFaultRepairWorkResponseType }{@code >}}
329      *
330      */
331     @XmlElementDecl(namespace = "http://pdjyh.soa.csg.cn", name = "PublishMVFaultRepairWorkResponse")
332     public JAXBElement<PublishMVFaultRepairWorkResponseType> createPublishMVFaultRepairWorkResponse(PublishMVFaultRepairWorkResponseType value) {
333         return new JAXBElement<PublishMVFaultRepairWorkResponseType>(_PublishMVFaultRepairWorkResponse_QNAME, PublishMVFaultRepairWorkResponseType.class, null, value);
334     }
335
336     /**
337      * Create an instance of {@link JAXBElement }{@code <}{@link EventMessageType }{@code >}}
338      *
339      */
340     @XmlElementDecl(namespace = "http://pdjyh.soa.csg.cn", name = "EventMessage")
341     public JAXBElement<EventMessageType> createEventMessage(EventMessageType value) {
342         return new JAXBElement<EventMessageType>(_EventMessage_QNAME, EventMessageType.class, null, value);
343     }
344
345     /**
346      * Create an instance of {@link JAXBElement }{@code <}{@link PublishMVFaultRepairWorkRequestType }{@code >}}
347      *
348      */
349     @XmlElementDecl(namespace = "http://pdjyh.soa.csg.cn", name = "PublishMVFaultRepairWorkRequest")
350     public JAXBElement<PublishMVFaultRepairWorkRequestType> createPublishMVFaultRepairWorkRequest(PublishMVFaultRepairWorkRequestType value) {
351         return new JAXBElement<PublishMVFaultRepairWorkRequestType>(_PublishMVFaultRepairWorkRequest_QNAME, PublishMVFaultRepairWorkRequestType.class, null, value);
352     }
353
354     /**
355      * Create an instance of {@link JAXBElement }{@code <}{@link RequestMessageType }{@code >}}
356      *
357      */
358     @XmlElementDecl(namespace = "http://pdjyh.soa.csg.cn", name = "RequestMessage")
359     public JAXBElement<RequestMessageType> createRequestMessage(RequestMessageType value) {
360         return new JAXBElement<RequestMessageType>(_RequestMessage_QNAME, RequestMessageType.class, null, value);
361     }
362
363     /**
364      * Create an instance of {@link JAXBElement }{@code <}{@link ResponseMessageType }{@code >}}
365      *
366      */
367     @XmlElementDecl(namespace = "http://pdjyh.soa.csg.cn", name = "ResponseMessage")
368     public JAXBElement<ResponseMessageType> createResponseMessage(ResponseMessageType value) {
369         return new JAXBElement<ResponseMessageType>(_ResponseMessage_QNAME, ResponseMessageType.class, null, value);
370     }
371
372 }

  

转载于:https://www.cnblogs.com/a2sha5/p/5071626.html

cxf返回的报文,命名空间无前缀相关推荐

  1. CSS3无前缀脚本prefixfree.js与Animatable使用介绍

    要求 必备知识 本文要求基本了解 JAVASCRIPT 和 和 CSS3 基本知识. 运行环境 桌面端:IE9 +,Opera 10+,火狐3.5 +,Safari 4+和Chrome浏览器;移动端: ...

  2. CSS3无前缀脚本prefixfree.js与Animatable使用

    现代浏览器基本支持CSS3,但是一些旧版本的浏览器还是需要添加前缀的.像box-shadow, border-radius这类属性,目前较新版本的浏览器都是不需要前缀的(包括IE9),但是,有些CSS ...

  3. python3 字符串前字母(无前缀,前缀u,前缀b,前缀r)含义

    字符串前加 u 后面字符串以 Unicode 格式 进行编码,一般用在中文字符串前面,防止因为源码储存格式问题,导致再次使用时出现乱码. 字符串前加 b python3.x里默认的str是(py2.x ...

  4. CSS3无前缀脚本prefixfree.js及Animatable介绍

    一.引导之言 虽然现代浏览器支持CSS3,但是一些过往的版本或是目前有些CSS3属性的应用还是离不开前缀的.像box-shadow, border-radius这类属性,目前较新版本的浏览器都是不需要 ...

  5. 后端接收到信息并返回了但是前端无响应_Bug的噩梦:前端调试必备的7个“大杀器”...

    全文共1527字,预计学习时长6分钟 图源:unsplash 应用程序漏洞,前端调试人员的秃头之源.如果您一直从事前端工作,就会知道修复应用程序漏洞有多么困难. 特别是使用JavaScript时,一个 ...

  6. 函数使用(函数定义及调用方式、传参与返回参数、命名空间、装饰器)

    函数定义及调用方式 一. 定义函数 1. 自定义函数的规则 • 函数代码块以 def 关键词开头,后接函数标识符名称和圆括号 ().     • 任何传入参数和自变量必须放在圆括号中间,圆括号之间可以 ...

  7. Android内嵌H5,安卓手机返回键点击无反应、苹果手机返回键正常情况解决方案

    定义一个返回APP的方法函数如下: function backForApp(delta = 1) {if (getCurrentPages().length > 1) {uni.navigate ...

  8. Postman模拟接口API:接收请求报文equest,响应返回固定报文response

    打开Postman,点击左上角New,选择Mock server 在新弹出页面中设置请求模式,请求地址,请求状态码和请求返回内容,不过这些在之后都可以进行修改的. 填写这个模拟服务的名称,也是后面可以 ...

  9. 如果我的接口必须返回Task,那么实现无操作的最佳方法是什么?

    本文翻译自:If my interface must return Task what is the best way to have a no-operation implementation? I ...

最新文章

  1. collection集合 多少钱_Java 集合(2)-- Iterator接口源码超级详细解析
  2. Spring的Bean实例化、属性注入、对象注入、复杂注入(基于xml配置方式)
  3. 单片机小精灵t2_51单片机定时器T2初始化设置
  4. Hive的安装-Hive配置
  5. Stream流中的常用方法_map
  6. 【CSS 】动画animation
  7. Qt::WA_QuitOnClose用法
  8. [python opencv 计算机视觉零基础到实战] 四、了解色彩空间及其详解
  9. Java知识点总结(注解-内置注解)
  10. 将一个包含有2层数据分组的表输出到EXCEL表里,并分组统计
  11. CANN 5.0硬核技术抢先看
  12. 苹果欲把 Swift 扶上位!
  13. java 查找引用_java – Eclipse查找方法的引用
  14. Java集合框架源码解读(4)——WeakHashMap
  15. VM14 安装黑苹果教程步骤
  16. PostGIS 报错libcrypto
  17. 为Linux安装虚拟PDF打印机
  18. IEEE期刊最新的影响因子
  19. 项目设计:基于STM32的指纹/刷卡的门禁/考勤/智能小区管理系统
  20. bugku中的misc题

热门文章

  1. php select user 验证,php 用户验证的简单示例
  2. geoserver 3_SD 2-3/15 PR调速阀德国HAWE哈威
  3. Mybatis快速入门的代码实现及报错处理解决org.apache.ibatis.exceptions.PersistenceException
  4. eclipse git提交代码_来看看大厂的Git提交规范,千万别乱提交代码哦...
  5. 杨辉三角Python解法
  6. 取0-1中间任意数java_java – 找到一个整数n 0,其中包含以下三个条件
  7. Spark On Yarn 运行模式(详细)
  8. java的lookAndfeel_java-LookAndFeel行为之间的区别
  9. 计算机导论sql试题,sql语句查询 练习题
  10. nbiot开发需要掌握什么_什么是前端工程师?前端工程师需要掌握什么技能?