【问题标题】:Apache CXF - WS addressing how to remove/delete ReplyTo from HeadersApache CXF - WS 解决如何从标题中删除/删除回复
【发布时间】:2016-04-02 05:14:01
【问题描述】:

我正在尝试使用 Apache CXF 2.7.18 实现 WS-Addressing。我可以设置一些标题,如 To、Action 等。但我想从 SOAP 请求中删除/删除 ReplyTo

<Action xmlns="http://www.w3.org/2005/08/addressing">http://...</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:....</MessageID>
<To xmlns="http://www.w3.org/2005/08/addressing">https://....</To>
<ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://www.w3.org/2005/08/addressing/anonymous</Address>
</ReplyTo>

有人知道怎么做吗?

【问题讨论】:

  • 您找到解决方案了吗?

标签: cxf ws-addressing


【解决方案1】:

我找到了一个解决方案,即使它有点脏,但它对我有用。我已明确将其设置为“null”(使用 Cxf 和 JaxWsProxyFactoryBean)。

    EndpointReferenceType replyTo = new EndpointReferenceType();
    AddressingProperties addrProperties = new AddressingProperties();
    AttributedURIType replyToURI = new AttributedURIType();

    EndpointReferenceType from = new EndpointReferenceType();
    AttributedURIType fromURI = new AttributedURIType();
    fromURI.setValue("ms-register");
    from.setAddress(fromURI);
    addrProperties.setFrom(from);
    addrProperties.setFrom(from);

    replyToURI.setValue(null);
    replyTo.setAddress(replyToURI);
    addrProperties.setReplyTo(replyTo);
    client.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES,addrPropertie);

【讨论】:

  • addrProperties 是什么变量?
  • AddressingProperties addrProperties = new AddressingProperties();您可以在其中设置 from addrProperties.setFrom(from)
猜你喜欢
  • 2022-01-08
  • 2015-02-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-28
  • 2015-10-16
  • 2021-04-20
  • 2018-10-13
相关资源
最近更新 更多