【发布时间】:2017-07-14 22:30:01
【问题描述】:
我正在使用 Apache CXF 3.1.12(使用 springboot)开发一个 soap 1.1 服务
我试图了解如何强制它生成 mustUnderstand 标头作为整数 (0|1) 而不是布尔值 (true|false)。请参阅下面的错误文档。据我了解,在肥皂 1.1 中,真/假是不可接受的。无论如何,我的客户不喜欢它,我无法控制他们。
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="true">http://...</a:Action>
</s:Header>
<s:Body>
...
</s:Body>
</s:Envelope>
这是一个 WSDL 优先的服务,并且在 WSDL 中没有提到 SOAP 1.2 命名空间。我的包裹信息是:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://...", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
我的端点是通过以下方式创建的:
EndpointImpl endpoint = new EndpointImpl(bus,
new MyClass(), SOAPBinding.SOAP11HTTP_BINDING);
我使用 hdr->setMustUnderstand(true) 在 Phase.WRITE 的 AbstractSoapInterceptor 中修改了 mustUnderstand 标头,但它仍然作为布尔值输出。
JIRA 中有一个老问题,很久以前就标记为已修复:https://issues.apache.org/jira/browse/CXF-2213?jql=text%20~%20%22mustUnderstand%22
任何帮助将不胜感激。
【问题讨论】:
标签: java spring-boot soap cxf