调用没有 Header 元素的服务时 WSO2 ESB 中的错误 [英] Error in WSO2 ESB when calling service without Header element

查看:25
本文介绍了调用没有 Header 元素的服务时 WSO2 ESB 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信我在 WSO2 ESB 中发现了错误.

I believe I found bug in WSO2 ESB.

我为我们的客户定义了代理服务.关闭安全性后,我总是会得到预期的结果,但是当我启用安全性(场景 1 - UsernameToken)时,我收到错误消息SOAP Envelope 不能有除 SOAP Header 和 Body 之外的子项".

I defined proxy service for our customer. With security turned off I always get expected result, but when I enable security (scenario 1 - UsernameToken), then I get error "SOAP Envelope can not have children other than SOAP Header and Body".

我可以使用echo"服务重现这个错误.

I'm able to reproduce this bug with 'echo' service.

这里是请求:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:echo="http://echo.services.core.carbon.wso2.org">
  <soap:Body>
    <echo:echoString>    
       <in>ABC</in>
    </echo:echoString>
  </soap:Body>
</soap:Envelope>

关闭安全性或在 元素之前添加 元素再次提供预期响应.

Turning security off or adding <soap:Header /> element before <soap:Body> element provides expected response again.

我使用 WSO2 ESB 4.8.1 版,SoapUI 5.0.0 作为客户端.

I'm using WSO2 ESB version 4.8.1, SoapUI 5.0.0 as client.

推荐答案

SOAP 标头包含与 SOAP 消息相关的应用程序特定信息.它们通常包含路由信息、身份验证信息、事务语义等.

The SOAP headers contain application specific information related to the SOAP message. They typically contain routing information, authentication information, transaction semantics etc.

如果您删除了 <soapenv:Header/> SoapUI 不会将您的用户名和密码发送到城墙.

If you removed <soapenv:Header/> SoapUI will not send your user name and password to rampart.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:echo="http://echo.services.core.carbon.wso2.org">
   <soapenv:Header/>
   <soapenv:Body>
      <echo:echoString>
         <!--Optional:-->
         <in>ABC</in>
      </echo:echoString>
   </soapenv:Body>
</soapenv:Envelope>

因此,由于 AxisEngine 系统错误,您的错误由 org.apache.axiom.soap.SOAPProcessingException 返回.

So your error was return by org.apache.axiom.soap.SOAPProcessingException due to AxisEngine System error.

当您的发送请求必须保护一个标头时..

When your sending request to secured one header is must..

这篇关于调用没有 Header 元素的服务时 WSO2 ESB 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆