jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/client/HttpTransportPipe.java
changeset 23782 953bfc3fbe31
parent 20590 b3b34e4344ce
equal deleted inserted replaced
23403:85dbdc227c5e 23782:953bfc3fbe31
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   255         }
   255         }
   256 
   256 
   257         // Allows only certain http status codes for a binding. For all
   257         // Allows only certain http status codes for a binding. For all
   258         // other status codes, throws exception
   258         // other status codes, throws exception
   259         checkStatusCode(responseStream, con); // throws ClientTransportException
   259         checkStatusCode(responseStream, con); // throws ClientTransportException
   260 
   260         //To avoid zero-length chunk for One-Way
       
   261         if (cl ==-1 && con.statusCode == 202 && "Accepted".equals(con.statusMessage) && responseStream != null) {
       
   262             ByteArrayBuffer buf = new ByteArrayBuffer();
       
   263             buf.write(responseStream); //What is within the responseStream?
       
   264             responseStream.close();
       
   265             responseStream = (buf.size()==0)? null : buf.newInputStream();
       
   266             buf.close();
       
   267         }
   261         Packet reply = request.createClientResponse(null);
   268         Packet reply = request.createClientResponse(null);
   262         reply.wasTransportSecure = con.isSecure();
   269         reply.wasTransportSecure = con.isSecure();
   263         if (responseStream != null) {
   270         if (responseStream != null) {
   264             String contentType = con.getContentType();
   271             String contentType = con.getContentType();
   265             if (contentType != null && contentType.contains("text/html") && binding instanceof SOAPBinding) {
   272             if (contentType != null && contentType.contains("text/html") && binding instanceof SOAPBinding) {