The processing instruction target matching "[xX][mM][lL]" is not allowed

版权声明:powered by 大狼狗郑锴/Moshow魔手 https://blog.csdn.net/moshowgame/article/details/84582119

问题背景

今天调试eas的ws接口,发现报错“The processing instruction target matching “[xX][mM][lL]” is not allowed”

解决方案

仔细检查XML,发现String strXml = " <?xml version='1.0'开头是不允许有空格的,可能是我用sublime text列模式修改导致。

也就是说格式化为XML的String,开头不能有空格,手工修改即可,或者可以加个trim()去掉头尾的空格即可。

		String    	strXml = "<?xml version='1.0' encoding='utf-8' standalone='yes'?>"+
		"<Request> "+
		"    <BillType>310</BillType> "+
		"    <BizType>210</BizType> "+
		"    <TransactionType>010</TransactionType> "+
		"    <SyncSystem>E3</SyncSystem> "
		//.....

猜你喜欢

转载自blog.csdn.net/moshowgame/article/details/84582119