CXF默认采用JAXB作为数据绑定方式, 从wsdl生成的客户端代码发送xml请求时,没有将xml命名空间写到soap head中,导致spring ws解析xml报错,需要在cxf客户端添加如下代码
或者采用其他数据绑定方式
Client client = ClientProxy.getClient(port);
client.getOutInterceptors();
HashMap<String, String> hmap = new HashMap<String, String>();
hmap.put("sch", "http://your/schemas");
client.getRequestContext().put("soap.env.ns.map", hmap);
client.getRequestContext().put("disable.outputstream.optimization", "true");
或者采用其他数据绑定方式