< prev index next >

jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java

Print this page


   1 /*
   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.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  59     public Message1_1Impl(SOAPMessage msg) {
  60         super(msg);
  61     }
  62 
  63     // unused. can we delete this? - Kohsuke
  64     public Message1_1Impl(MimeHeaders headers, InputStream in)
  65         throws IOException, SOAPExceptionImpl {
  66         super(headers, in);
  67     }
  68 
  69     public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
  70         throws SOAPExceptionImpl {
  71         super(headers,ct,stat,in);
  72     }
  73 
  74     public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader)
  75             throws SOAPExceptionImpl {
  76             super(headers,ct,stat,reader);
  77     }
  78 

  79     public SOAPPart getSOAPPart() {
  80         if (soapPartImpl == null) {
  81             soapPartImpl = new SOAPPart1_1Impl(this);
  82         }
  83         return soapPartImpl;
  84     }
  85 

  86     protected boolean isCorrectSoapVersion(int contentTypeId) {
  87         return (contentTypeId & SOAP1_1_FLAG) != 0;
  88     }
  89 

  90     public String getAction() {
  91         log.log(
  92             Level.SEVERE,
  93             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
  94             new String[] { "Action" });
  95         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
  96     }
  97 

  98     public void setAction(String type) {
  99         log.log(
 100             Level.SEVERE,
 101             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
 102             new String[] { "Action" });
 103         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
 104     }
 105 

 106     public String getCharset() {
 107         log.log(
 108             Level.SEVERE,
 109             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
 110             new String[] { "Charset" });
 111         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
 112     }
 113 

 114     public void setCharset(String charset) {
 115         log.log(
 116             Level.SEVERE,
 117             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
 118             new String[] { "Charset" });
 119         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
 120     }
 121 

 122     protected String getExpectedContentType() {
 123         return isFastInfoset ? "application/fastinfoset" : "text/xml";
 124     }
 125 

 126    protected String getExpectedAcceptHeader() {
 127        String accept = "text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
 128        return acceptFastInfoset ? ("application/fastinfoset, " + accept) : accept;
 129    }
 130 
 131 }
   1 /*
   2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  59     public Message1_1Impl(SOAPMessage msg) {
  60         super(msg);
  61     }
  62 
  63     // unused. can we delete this? - Kohsuke
  64     public Message1_1Impl(MimeHeaders headers, InputStream in)
  65         throws IOException, SOAPExceptionImpl {
  66         super(headers, in);
  67     }
  68 
  69     public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
  70         throws SOAPExceptionImpl {
  71         super(headers,ct,stat,in);
  72     }
  73 
  74     public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader)
  75             throws SOAPExceptionImpl {
  76             super(headers,ct,stat,reader);
  77     }
  78 
  79     @Override
  80     public SOAPPart getSOAPPart() {
  81         if (soapPartImpl == null) {
  82             soapPartImpl = new SOAPPart1_1Impl(this);
  83         }
  84         return soapPartImpl;
  85     }
  86 
  87     @Override
  88     protected boolean isCorrectSoapVersion(int contentTypeId) {
  89         return (contentTypeId & SOAP1_1_FLAG) != 0;
  90     }
  91 
  92     @Override
  93     public String getAction() {
  94         log.log(
  95             Level.SEVERE,
  96             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
  97             new String[] { "Action" });
  98         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
  99     }
 100 
 101     @Override
 102     public void setAction(String type) {
 103         log.log(
 104             Level.SEVERE,
 105             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
 106             new String[] { "Action" });
 107         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
 108     }
 109 
 110     @Override
 111     public String getCharset() {
 112         log.log(
 113             Level.SEVERE,
 114             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
 115             new String[] { "Charset" });
 116         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
 117     }
 118 
 119     @Override
 120     public void setCharset(String charset) {
 121         log.log(
 122             Level.SEVERE,
 123             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
 124             new String[] { "Charset" });
 125         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
 126     }
 127 
 128     @Override
 129     protected String getExpectedContentType() {
 130         return isFastInfoset ? "application/fastinfoset" : "text/xml";
 131     }
 132 
 133     @Override
 134    protected String getExpectedAcceptHeader() {
 135        String accept = "text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
 136        return acceptFastInfoset ? ("application/fastinfoset, " + accept) : accept;
 137    }
 138 
 139 }
< prev index next >