【问题标题】:Element not allowed: node@http://schemas.xmlsoap.org/soap/envelope不允许的元素:node@http://schemas.xmlsoap.org/soap/envelope
【发布时间】:2018-02-24 08:51:45
【问题描述】:

当我在 SOAP UI 中添加 SOAP UI 架构验证作为断言的一部分时,我收到以下错误:

Element not allowed: node@http://schemas.xmlsoap.org/soap/envelope in element Header@http://schemas.xmlsoap.org/soap/envelope

谁能告诉我为什么这会失败?以及如何解决这个问题?

XML 验证:

<soap:Envelope xmlns:ns0="urn:xeu:flux-transport:v1" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<soap:node datetime="2018-02-02T10:31:08.006Z">ABC</soap:processingNode>
</soap:Header>
<soap:Body>
<blah>
</blah>
</soap:Body>
</soap:Envelope>

WSDL(用于在 SOAP UI 中进行验证):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:documentation>Version: 1.0</wsdl:documentation>
    <wsdl:types>
        <xsd:schema>    
            <import namespace="http://schemas.xmlsoap.org/soap/envelope/"   
        schemaLocation="http://schemas.xmlsoap.org/soap/envelope/" />
        </xsd:schema>
    </wsdl:types>
</wsdl:definitions>

任何帮助表示赞赏。

【问题讨论】:

    标签: soap soapui xsd-validation


    【解决方案1】:

    从您的请求中删除元素 node 或以下行:

    <soap:node datetime="2018-02-02T10:31:08.006Z">ABC</soap:processingNode>
    

    另外,开始和结束节点名称也不同。

    【讨论】:

    • 抱歉 - 我的意思是如何修复验证而不是 XML 来正确验证它?
    • 我相信该节点不允许在那里。因此要求将其删除。
    • 我明白 - 但如何修复架构以便验证?
    猜你喜欢
    • 1970-01-01
    • 2014-04-22
    • 1970-01-01
    • 1970-01-01
    • 2020-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多