【问题标题】:Couldn't create SOAP message due to exception: unexpected XML tag. WSO2 Integration Studio由于异常,无法创建 SOAP 消息:意外的 XML 标记。 WSO2 集成工作室
【发布时间】:2022-08-15 03:53:13
【问题描述】:

我正在尝试使用调用中介向 SOAP API 发送请求。使用 SoapUI 时收到正确响应,但在 WSO2 Integration Studio 上尝试时出现以下错误。

<faultstring>Couldn\'t create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {some-url}Fulfillments</faultstring>

这是我的 Insequence 的内容。

我没有找到合适的解决方案。知道如何解决这个问题吗?提前致谢!

<payloadFactory media-type=\"xml\">
                <format>
                    <soapenv:Envelope xmlns:loc=\"some-url\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">
                        <soapenv:Header/>
                        <soapenv:Body>
                            <loc:Fulfillments>
                                
                                
                                    <message_header >
                                        
                                    </message_header>
                                    <message_body>
                                        
                                    </message_body>
                                
                            </loc:Fulfillments>
                        </soapenv:Body>
                    </soapenv:Envelope>
                </format>
                <args/>
            </payloadFactory>

                 <property name=\"messageType\" scope=\"axis2\" type=\"STRING\" value=\"text/xml\"/>
                 <property name=\"Content-Type\" scope=\"axis2\" type=\"STRING\" value=\"text/xml\"/>
                 <!-- Setting the Credentials-->
                 <property name=\"Action\" scope=\"transport\" type=\"STRING\" value=\"\"/>
           <call>
                <endpoint>
                    <address format=\"soap11\" uri=\"\">
                        <timeout>
                            <duration>60000</duration>
                            <responseAction>fault</responseAction>
                        </timeout>
                    </address>
                </endpoint>
            </call>

            <property name=\"messageType\" scope=\"axis2\" type=\"STRING\" value=\"text/xml\"/>
            <property name=\"Content-Type\" scope=\"axis2\" type=\"STRING\" value=\"text/xml\"/>
            <respond/>

  • 你用的是什么EI版本?您在axis2.xml 或deployment.toml 中配置了哪些消息格式化程序?消息必须是 SOAP 1.1 还是后端支持 SOAP 1.1 和 1.2?
  • 我使用的EI版本是7.2.0。我正在使用 WSO2-MI-4.0.0 提供的默认消息格式化程序。后端仅支持 1.1。
  • 如果您删除您的&lt;!-- Setting the Credentials--&gt; 序列,它会起作用吗?
  • 如果我删除凭据,我会得到相同的响应。我得到相同的无信封错误。
  • 这是否意味着它没有进入授权部分?但是授权之后的所有日志都会被打印出来。

标签: soap wso2 wso2-esb wso2-integration-studio


【解决方案1】:

尝试使用响应调解器检查负载工厂返回的负载是什么。

如果 wso2 没有保留或删除肥皂信封标签,请使用以下属性。

&lt;property name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/&gt;

【讨论】:

    猜你喜欢
    • 2012-01-30
    • 2015-11-17
    • 1970-01-01
    • 2021-03-03
    • 1970-01-01
    • 2015-12-20
    • 2021-09-11
    • 2021-01-22
    • 2018-08-23
    相关资源
    最近更新 更多