Document オブジェクトを作成すると、早すぎるファイル終了エラーが発生します。このコードは数日前に機能していましたが、現在エラーをスローする原因がわかりません。
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource(new StringReader(response));
Document doc = builder.parse(is);
[致命的なエラー] :1:1: ファイルの終わりが早すぎます。
これが私が受け取っている応答xmlです。それは完全にうまく見えます。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetBatchFilesResponse xmlns="http://....">
<GetBatchFilesResult>
<BatchFile>
<Uri>someURI</Uri>
<ID>2025961</ID>
<FQName>someFileName</FQName>
</BatchFile>
</GetBatchFilesResult>
</GetBatchFilesResponse>
</soap:Body>
</soap:Envelope>