Error in WSO2 ESB when calling service without Header element

情到浓时终转凉″ 提交于 2019-12-11 14:19:35

问题


I believe I found bug in WSO2 ESB.

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".

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

Here is request:

<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.

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


回答1:


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

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>

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..



来源:https://stackoverflow.com/questions/23343441/error-in-wso2-esb-when-calling-service-without-header-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!