Author: alessio.soldano(a)jboss.com
Date: 2010-10-04 09:49:26 -0400 (Mon, 04 Oct 2010)
New Revision: 13055
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
Log:
[JBWS-3084] Skip build of response message for empty streams (prevent failure with one-way
requests)
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2010-10-04
13:48:22 UTC (rev 13054)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2010-10-04
13:49:26 UTC (rev 13055)
@@ -167,6 +167,22 @@
}
}
+ //if inputstream is empty, no need to build
+ if (ins.markSupported())
+ {
+ ins.mark(1);
+ final int bytesRead = ins.read(new byte[1]);
+ ins.reset();
+ if (bytesRead == -1)
+ {
+ return null;
+ }
+ }
+ else if (ins.available() == 0)
+ {
+ return null;
+ }
+
MessageFactory msgFac =
MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
return msgFac.createMessage(mimeHeaders, ins);
}
Show replies by date