Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 5a06cb2

Browse files
author
Roman Grigoriadi
committed
Incorrect escape handling caused 'SAAJ0543: Entity References are not allowed in SOAP documents' when custom handler is added.
Fixes #1220 Signed-off-by: Roman Grigoriadi <roman.grigoriadi@oracle.com>
1 parent d2f56be commit 5a06cb2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

jaxws-ri/rt/src/main/java/com/sun/xml/ws/api/streaming/XMLStreamWriterFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -416,7 +416,7 @@ public void doRecycle(XMLStreamWriter r) {
416416

417417
}
418418

419-
private static class HasEncodingWriter extends XMLStreamWriterFilter implements HasEncoding {
419+
public static class HasEncodingWriter extends XMLStreamWriterFilter implements HasEncoding {
420420
private final String encoding;
421421

422422
HasEncodingWriter(XMLStreamWriter writer, String encoding) {
@@ -429,7 +429,7 @@ public String getEncoding() {
429429
return encoding;
430430
}
431431

432-
XMLStreamWriter getWriter() {
432+
public XMLStreamWriter getWriter() {
433433
return writer;
434434
}
435435
}

jaxws-ri/rt/src/main/java/com/sun/xml/ws/streaming/XMLStreamWriterUtil.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 1997-2018 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -41,6 +41,7 @@
4141
package com.sun.xml.ws.streaming;
4242

4343
import com.sun.istack.Nullable;
44+
import com.sun.xml.ws.api.streaming.XMLStreamWriterFactory;
4445
import com.sun.xml.ws.encoding.HasEncoding;
4546
import com.sun.xml.ws.encoding.SOAPBindingCodec;
4647

@@ -72,9 +73,14 @@ private XMLStreamWriterUtil() {
7273
public static @Nullable OutputStream getOutputStream(XMLStreamWriter writer) throws XMLStreamException {
7374
Object obj = null;
7475

76+
XMLStreamWriter xmlStreamWriter =
77+
writer instanceof XMLStreamWriterFactory.HasEncodingWriter ?
78+
((XMLStreamWriterFactory.HasEncodingWriter) writer).getWriter()
79+
: writer;
80+
7581
// Hack for JDK6's SJSXP
76-
if (writer instanceof Map) {
77-
obj = ((Map) writer).get("sjsxp-outputstream");
82+
if (xmlStreamWriter instanceof Map) {
83+
obj = ((Map) xmlStreamWriter).get("sjsxp-outputstream");
7884
}
7985

8086
// woodstox

0 commit comments

Comments
 (0)