我有一个XML文件 soap2.xml ,其中包含以下内容:
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<BaseInfo>
<TransId>P00C000-2017091907266</TransId>
<UnitCode>23</UnitCode>
<Camera_Slno>0077</Camera_Slno>
<UserId>SYSTEM</UserId>
<UserName>xyz</UserName>
<ViolationDate>19-09-2017</ViolationDate>
<ViolationTime>12:18:28</ViolationTime>
<TimeStamp>1.5058e+09</TimeStamp>
<VehicleNum>TN75WB5731</VehicleNum>
<Violation>
<ViolationCode>05</ViolationCode>
<VehicleSpeed>0</VehicleSpeed>
<SpeedLimit></SpeedLimit>
<TransactionFiles>
<FrontalImage>http://10.77.1.36/P00C000-2017091907266.jpg;</FrontalImage>
<ContextImage></ContextImage>
<LPImage>http://10.77.1.36/P00C000-2017091907266_1.jpg</LPImage>
<ANPRVideo></ANPRVideo>
<ContextVideo></ContextVideo>
</TransactionFiles>
</Violation>
</BaseInfo>
</soap:Body>
</soap:Envelope>
我正通过以下命令发送肥皂请求:
curl -X POST -H "soapAction:''" --data @soap2.xml http://135.12.0.60:8080/ITMSeChallanGeneration/services/ITMSeChallanImpl?wsdl
我将XML作为响应,它显示了一些错误:
<?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.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">Sunil</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
我不知道是格式问题还是请求正文问题或XML问题。 任何帮助将不胜感激。我是SOAP服务的初学者,所以不知道它。 我使用的是CentOS-7.2。