微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

unexpected element (uri:"", local:"prescDrug"). Expected elements 错误

soap协议访问webservice,如果入参中有list,需如下写入参格式


 "<?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>"
				+ "<ns1:postPresc soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns1=\"http://service.webService.com\">"
				+ "<prescInfos>"
				+ "<hospId>1001</hospId>"
				+ "<hospName>杭州第一医院</hospName>"
				+ "<patientCard>A12345678</patientCard>"
				+ "<patientName>1000</patientName>"
				+ "<patientPhone>1000</patientPhone>"
				+ "<postType>2</postType>"
				+ "<prescCode>NO123412</prescCode>"
				+ <span style="color:#6633ff;">"<prescDrugs>"</span>
				+ "<drugCode>1000</drugCode>"
				+ "<quantity>1000</quantity>"
				+ "<remark>最好别吃</remark>"
				+ <span style="color:#6600cc;">"</prescDrugs>"</span>
				+ "</prescInfos>"
				+ "</ns1:postPresc>"
				+ "</soapenv:Body>" + "</soapenv:Envelope>"


实体如下:

public class PrescInfo {
int hospId;// 医院编号
String hospName;// 医院名称
String prescCode;// 医院处方编号
String patientCard;// 患者卡号
String patientName;// 患者姓名
String patientPhone;// 患者手机
int postType;// 传送类型,1新增,2更新
List<PrescDrug> prescDrugs;// 处方药品信息列表 <<<<<<<这里参数是list

......

}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐