Я работаю с SOAP XML. Я успешно проверил мой xml онлайн, но при отправке на сервер я получаю сообщение об ошибке "неожиданный тег XML. Ожидается: {http://schemas.xmlsoap.org/soap/envelope/}Body, но найдено: {http://schemas.xmlsoap.org/soap/envelope/}Envelope", это xml отправляю
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:pos="http://pos/">
<soapenv:Header>
<soapenv:Body>
<pos:balanceInquiry>
<iccData></iccData>
<pinBlock></pinBlock>
<terminalId></terminalId>
</pos:balanceInquiry>
</soapenv:Body>
</soapenv:Header>
Я удалил значения в тегах, все осталось прежним.
@Root(name = "soapenv:Envelope")
@NamespaceList({
@Namespace( prefix = "soapenv", reference = "http://schemas.xmlsoap.org/soap/envelope/"),
@Namespace( prefix = "pos", reference = "http://pos/")
})
public class XMLRequestEnvelope {
@Element(name = "soapenv:Header", required = false)
private XMLRequestHeader header;
public XMLRequestHeader getHeader() {
return header;
}
public void setHeader(XMLRequestHeader header) {
this.header = header;
}
}
@ Root (name = "soapenv: Header", строгий = ложный)
открытый класс XMLRequestHeader {
@Element(name = "soapenv:Body", required = false)
private XMLRequestBody body;
public XMLRequestBody getBody() {
return body;
}
public void setBody(XMLRequestBody body) {
this.body = body;
}
}
@Root(name = "soapenv:Body", strict = false)
public class XMLRequestBody {
@Element(name = "pos:balanceInquiry",required = false)
private XMLBalanceInquiry xmlBalanceInquiry;
public XMLBalanceInquiry getXmlBalanceInquiry() {
return xmlBalanceInquiry;
}
public void setXmlBalanceInquiry(XMLBalanceInquiry xmlBalanceInquiry) {
this.xmlBalanceInquiry = xmlBalanceInquiry;
}
}
@Root(name = "pos:balanceInquiry", strict = false)
public class XMLBalanceInquiry {
@Element(name = "iccData", required = false)
private String emvData;
@Element(name = "pinBlock", required = false)
private String pinBlock;
@Element(name = "phoneNo", required = false)
private String phoneNo;
@Element(name = "terminalId", required = false)
private String terminalId;
public String getEmvData() {
return emvData;
}
public void setEmvData(String emvData) {
this.emvData = emvData;
}
public String getPinBlock() {
return pinBlock;
}
public void setPinBlock(String pinBlock) {
this.pinBlock = pinBlock;
}
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public String getTerminalId() {
return terminalId;
}
public void setTerminalId(String terminalId) {
this.terminalId = terminalId;
}
}