soap请求报文格式问题,the processing instruction target matching "[xX][mM][lL]" is not allowed.

2022-05-07 10:27:50

没有xml标题头的话没有问题,前面有空格没有问题

image.png

有标题头(已下,<?xml 开头的)的话,前面有空格 dom4j解析报错。

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

出现这个问题是因为xml格式不正确导致的,<?xml version="1.0" encoding="UTF-8"?>前面不要有任何其他字符(包括空格和换行),这个错误纯粹是画蛇添足导致的。

image.png