3

我们将以下 SOAP XML 发送到服务器

<?xml version="1.0" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">   
<SOAP-ENV:Header/>    
<SOAP-ENV:Body>        
<ns2:search xmlns:ns2="http://search.tbx.codegen.it">            
    <arg0/>            
    <arg1/>            
    <arg2 xmlns:ns4="http://criteria.search.tbx.codegen.it" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:AccomSearchCriteria">                
       <adult>1</adult>
         ...
    </arg2>            
    <arg3>50</arg3>        
</ns2:search>    
</SOAP-ENV:Body></SOAP-ENV:Envelope>

但是服务器为此遇到以下错误

SEVERE: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxParsingException: Duplicate declaration for namespace prefix 'SOAP-ENV'.
 at [row,col {unknown-source}]: [1,132]
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxParsingException: Duplicate declaration for namespace prefix 'SOAP-ENV'.
 at [row,col {unknown-source}]: [1,132]
        at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:359)
        at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:318)

我们发送的 XML 消息有什么问题吗(重复的命名空间前缀“SOAP-ENV”)?

谢谢大家

4

0 回答 0