天天看点

Caused by: com.ctc.wstx.exc.WstxParsingException: Received non-all-whitespace CHARACTERS or CDATA event in nextTag()

java client 调用webservice, 返回以下错误:

返回message:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault>java.lang.Exception:  Invalid SOAP formart for xml!           

日志:

Caused by: com.ctc.wstx.exc.WstxParsingException: Received non-all-whitespace CHARACTERS or CDATA event in nextTag().
 at [row,col {unknown-source}]: [3,528]           

原因是发送的message中缺少了

<env:Header/>           

soap envelope schema定义中, header似乎是任意的, 可以没有.