标签: ws-addressing

什么是WS-Addressing有用?

我刚刚开始使用SOAP Web服务,偶然发现了WS-Addressing.

我已阅读维基百科页面,但我很难理解WS-Addressing的重点.

根据维基百科和Web上的各种来源,WS-Addressing允许将"寻址信息"或"路由信息"放入SOAP请求的标头中.

为什么这有用?如果我通过HTTP(或甚至通过SMTP或UDP)发送请求,那么我发送到的地址是将处理我的请求的服务器的地址,并且服务器可以简单地通过相同的通道进行回复.那么为什么需要寻址/路由信息呢?

我对一些真实世界(或多或少)WS-Addressing有用的例子特别感兴趣.

soap web-services ws-addressing

28
推荐指数
1
解决办法
9935
查看次数

使用Wss4jSecurityInterceptor和Java的SOAP WS-Addressing属性

嗨,我创建消费SOAP服务的代码,

对于Authentication Header,我使用Wss4jSecurityInterceptor来设置Header信息.

我收到如下的失败回应

 Exception in thread "main" org.springframework.ws.soap.client.SoapFaultClientException: Required element {http://www.w3.org/2005/08/addressing}Action is missing
Run Code Online (Sandbox Code Playgroud)

我的配置代码如下

@Configuration
public class SoapClientConfig {

    @Bean
    public Jaxb2Marshaller marshaller() {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
        marshaller.setContextPath("com.xyz.client");
        marshaller.setCheckForXmlRootElement(false);
        return marshaller;
    }

    @Bean
    public MyClient myClient(Jaxb2Marshaller marshaller) throws Exception {
        MyClient client = new MyClient();
        client.setDefaultUri("https://localhost:8080/ws/service");
        client.setMarshaller(marshaller);
        client.setUnmarshaller(marshaller);

        ClientInterceptor[] interceptors = new ClientInterceptor[] {securityInterceptor()};

        client.setInterceptors(interceptors);
        return client;
    }

    @Bean
    public Wss4jSecurityInterceptor securityInterceptor() {
        Wss4jSecurityInterceptor wss4jSecurityInterceptor = new Wss4jSecurityInterceptor();
        wss4jSecurityInterceptor.setSecurementActions("UsernameToken");
        wss4jSecurityInterceptor.setSecurementMustUnderstand(true);
        wss4jSecurityInterceptor.setSecurementPasswordType("PasswordText");
        wss4jSecurityInterceptor.setSecurementUsername("XXXXXXXXXXX");
        wss4jSecurityInterceptor.setSecurementPassword("XXXXXXXX");
        return wss4jSecurityInterceptor;
    }
} …
Run Code Online (Sandbox Code Playgroud)

java soap web-services ws-addressing soap-client

10
推荐指数
1
解决办法
1014
查看次数

如何在WCF中使用WS-Addressing并设置wsa:replyto标头?

我正在使用WCF调用BizTalk服务.该服务要求在SOAP标头中设置wsa:replyto地址,以便在完成该过程时进行"回调".

我们正在使用合同优先的approch来自svcutil的自动生成代码(我们不能'只是'改变合同)......

并且在配置文件中不可能...

我看到有人'覆盖'某些方法来制作自己的自定义标头 - 但这不是自定义标头,而是SOAP协议中的标准.

如何在(SOAP)标头中添加wsa:replyto?

wcf soap ws-addressing c#-4.0

10
推荐指数
1
解决办法
1万
查看次数

如何在Axis2客户端中正确使用WS-Addressing?

所有,我正在尝试编写一个在Axis2.1.5中调用Web服务客户端的Junit测试,并且我对如何将其设置为使用WS-Addressing感到困惑.

我使用wsdl2java生成了一个客户端存根,我正在使用来自axis2二进制分发的axis2.xml和modules存储库.

我知道我需要使用的WS-Addressing的MemberSubmission版本,我我已经得到了正确设置(使用选项),但似乎是头不得到正确生成.(我说'似乎'因为我无法弄清楚如何使用SOAPMonitor模块 - 我也欢迎任何提示!).

然而,我的主要困惑在于"参与"寻址模块究竟需要什么.是否足以使用具有对寻址模块的引用的axis2.xml文件来设置ConfigurationContext?像这样?:

//standard out of the box axis2 configs
 ConfigurationContext myConfigContext = ConfigurationContextFactory
   .createConfigurationContextFromFileSystem("C:/devapps/axis2-1.5.1/repository","C:/devapps/axis2-1.5.1/conf/axis2.xml");

  Options options = new Options();
  EndpointReference targetEPR = new EndpointReference(
    "https://host:port/service.asmx");

  options.setTo(targetEPR);

                //I believe this is what I'm supposed to do to specify the 
  //MemberSubmission version of WS-Addressing
  options.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
    AddressingConstants.Submission.WSA_NAMESPACE);
  //No idea of this is needed or not.
  options.setProperty(AddressingConstants.INCLUDE_OPTIONAL_HEADERS,
    Boolean.TRUE);
  options.activate(myConfigContext);
  options.setAction("someAction");

  CaseDetailsServiceStub stub = new CaseDetailsServiceStub(
    "https://host:port/service.asmx");
  stub._getServiceClient().setOptions(options);

  //I'm calling this from a Junit test
  assertNotNull(stub.someAction(someParam));
Run Code Online (Sandbox Code Playgroud)

使用上面设置的选项,在日志文件中看到模块从axis2.xml加载:

[INFO] Deploying …
Run Code Online (Sandbox Code Playgroud)

java axis2 ws-addressing

8
推荐指数
1
解决办法
1万
查看次数

WS-Addressing的目的是什么?

我只是对ws-addressing感到困惑.

维基百科称,它是一种传输中立机制的规范,允许Web服务"传递寻址信息".

沟通寻址信息?SOAP Web服务是否已具备开始时的能力,否则它们将如何进行通信?

鉴于它似乎提供核心功能,它给出了什么价值,为什么不是默认的东西的一部分?

java soap web-services jax-ws ws-addressing

7
推荐指数
1
解决办法
1554
查看次数

有哪些选项可用于在Delphi中使用SOAP实现长轮询?

我有一个Delphi企业应用程序,它充当Java后端(SOAP,Axis2)的客户端.我的一些请求需要不确定或特别大的时间才能完成,我想为SOAP请求实现一个长轮询解决方案.

据我所知,我通常会使用WS-Addressing.但是,似乎Delphi SOAP客户端(WCF)没有实现WS-Addressing.

我被锁定在Java和Delphi中.我使用Axis 2组件,例如生命周期,但我可以转换到另一个Web服务引擎.我控制服务器和客户端.

在Delphi和Java中实现长轮询有哪些选择?

java delphi soap ws-addressing delphi-xe2

6
推荐指数
1
解决办法
577
查看次数

Spring-WS 中的@PayloadRoot、@Action、@SoapAction

有人可以解释为什么我会在 spring-ws 中使用这些端点注释之一而不是另一个吗?特别是,哪一个被认为最具包容性?我可以同时使用这三个吗?我已阅读该文档,并且知道 @Action 使用 ws-addressing 而 @SoapAction 使用 SOAP Action 传输标头,但我不太确定哪个更适合使用。

谢谢。

java soap spring-ws ws-addressing

6
推荐指数
1
解决办法
3493
查看次数

WCF wsHttpBinding通过防火墙的有趣问题

我在互联网托管服务提供商中部署了一个Web应用程序.此Web应用程序使用部署在我公司应用程序服务器的IIS服务器上的WCF服务,以便能够访问公司的数据库,网络人员允许我出于安全原因通过防火墙公开此WCF服务.图表看起来像这样.

[主页] --->(Internet)---> |防火墙<Public IP>:<Port-X >| ---> [带WCF服务的IIS <Comp. Network Ip>:<Port-Y>]

我还想使用wsHttpBinding来利用其安全功能,并加密敏感信息.

尝试后,我收到以下错误:

异常详细信息:System.ServiceModel.EndpointNotFoundException:由于EndpointDispatcher上的AddressFilter不匹配,无法在接收方处理带有To'http://:/service/WCFService.svc'的消息.检查发送方和接收方的EndpointAddresses是否一致.

做一些研究我发现wsHttpBinding使用WS-Addressing标准,并且阅读了这个标准,我了解到SOAP标头已经增强,包括'MessageID','ReplyTo','Action'和'To'等标签.

所以我猜测,因为客户端应用程序端点指定防火墙IP地址和端口,并且服务使用与防火墙IP不同的内部网络地址进行回复,然后WS-Addressing将触发上述消息.我认为这是一个非常好的安全措施,但在我的方案中它并不是很有用.

引用WS-Addressing标准提交(http://www.w3.org/Submission/ws-addressing/)

"由于目前广泛使用的网络技术范围广泛(例如,NAT,DHCP,防火墙),许多部署无法为给定端点分配有意义的全局URI.允许这些"匿名"端点启动消息交换模式和接收回复时,WS-Addressing定义了以下众所周知的URI,供不能具有稳定,可解析的URI的端点使用 .http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous "

我如何配置我的wsHttpBinding端点来解决我的防火墙的IP并忽略或绕过SOAP消息头中"To"WS-Addressing标记中指定的地址?或者我是否必须在服务端点配置中更改某些内容?

非常感谢帮助和指导.

马尔科.

PS:虽然我找到了解决方法,但我当然使用basicHttpBinding完全没问题.

wcf firewall ws-addressing wshttpbinding

5
推荐指数
1
解决办法
7242
查看次数

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

我正在尝试使用 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>
Run Code Online (Sandbox Code Playgroud)

有人知道怎么做吗?

cxf ws-addressing

5
推荐指数
1
解决办法
436
查看次数

如何在 spring 中启用 ws-addressing 以便回复可以被理解?

我使用 spring-boot-starter-webservices 使用 spring 创建了一个 ws 端点。

我用过@org.springframework.ws.server.endpoint.annotation.Endpoint,效果很好。

但是当我尝试将寻址标头添加到带有服务器打印的wsa:ReplyTo请求时:mustUnderstand=true

无法处理 MustUnderstand 标头:{http://www.w3.org/2005/08/addressing}ReplyTo。返回故障

并返回类似的故障作为响应。

如何启用寻址以便ReplyTo被理解并回复202,将响应发送到中描述的不同端点ReplyTo

我尝试添加@javax.xml.ws.soap.Addressing(enabled=true)旁边的@Endpoint注释,但我仍然得到上述行为。

spring jax-ws ws-addressing spring-boot

5
推荐指数
0
解决办法
372
查看次数

Apache CXF - WS解决了如何设置From,ReplyTo,Headers的问题

我有一个问题:我们正在尝试使用Apache CXF实现WS-Addressing.我可以设置一些像To或Action这样的标题,但我找不到设置其他像From,ReplyTo或FaultTo的方法.

有谁知道怎么做?

cxf ws-addressing

4
推荐指数
1
解决办法
2412
查看次数

在“手动”发送肥皂消息时,我收到 WCF 的 AddressingNone 错误

我正在尝试通过 SOAP 消息(我已提取)发送到我的 WCF 服务,而不使用 WCF 客户端基础结构。在不使用我的生产消息(和代码)的情况下,我已经能够设置同一问题的虚拟版本(感谢 WF_WCF_Samples)。

所以合同看起来像这样:

[ServiceContract(Namespace="http://Microsoft.Samples.UsingUsing")]
public interface ICalculator
{
    [OperationContract]
    double Add(double n1, double n2);
    [OperationContract]
    double Subtract(double n1, double n2);
    [OperationContract]
    double Multiply(double n1, double n2);
    [OperationContract]
    double Divide(double n1, double n2);
}
Run Code Online (Sandbox Code Playgroud)

查看实际 WCF 客户端发送的 SOAP 消息,我在 WCF 跟踪中得到以下信息:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:56852/service.svc</To>
        <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://Microsoft.Samples.UsingUsing/ICalculator/Divide</Action>
    </s:Header>
    <s:Body>
        <Divide xmlns="http://Microsoft.Samples.UsingUsing">
            <n1>0</n1>
            <n2>0</n2>
        </Divide>
    </s:Body>
</s:Envelope>
Run Code Online (Sandbox Code Playgroud)

这是工作电话中的内容。但是,如果我尝试执行此操作,则会收到记录在 WCF 跟踪中的以下异常:

寻址版本“AddressingNone ( http://schemas.microsoft.com/ws/2005/05/addressing/none )”不支持添加 WS-Addressing 标头。

我尝试过使用 SoapUI 甚至 Httpie 来发送 XML 文件: …

xml wcf soap ws-addressing

2
推荐指数
1
解决办法
1642
查看次数