org.xml.sax.SAXParseException; 元素的前缀;没有绑定

Jaw*_*Dev 5 xml soap

我正在尝试从邮递员访问我的肥皂服务方法...并使用 XML 中的以下正文。

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
    <soap:Body>
        <EchoTransaction xmlns="https://localhost:7003/TestService/service/TestServiceServiceImpl">
            <userName>faseeh</userName>
            <password>haris</password>
            <ping>hello</ping>
        </EchoTransaction>
    </soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)

但它抛出错误:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server.userException</faultcode>
            <faultstring>org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 114; The prefix &quot;soap&quot; for element &quot;soap:Envelope&quot; is not bound.</faultstring>
            <detail>
                <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">WorkStation</ns1:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>
Run Code Online (Sandbox Code Playgroud)

myURL 是:https://localhost:7003/TestService/service/TestServiceServiceImpl?op=EchoTransaction

我尝试了 xml 架构标记更改,但没有解决我的问题。

请帮忙..

Mic*_*Kay 6

该错误的含义正如其所言:您有一个带有命名空间前缀的元素

<soap:Envelope...>
Run Code Online (Sandbox Code Playgroud)

并且没有xmlns:soap="..."将soap前缀绑定到命名空间URI的声明。