gpt4 book ai didi

cxf - Apache CXF - WS 解决如何从标题中删除/删除 ReplyTo

转载 作者:行者123 更新时间:2023-12-03 17:17:44 26 4
gpt4 key购买 nike

我正在尝试使用 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>

有人知道怎么做吗?

最佳答案

我找到了一个解决方案,即使它有点脏,但它对我有用。我已经明确地将它设置为“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);

关于cxf - Apache CXF - WS 解决如何从标题中删除/删除 ReplyTo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34492085/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com