KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > soap > Constants


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2000 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "SOAP" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 2000, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package org.apache.soap;
59
60 import org.apache.soap.util.xml.QName;
61
62 /**
63  * <em>SOAP</em> constants.
64  *
65  * @author Sanjiva Weerawarana (sanjiva@watson.ibm.com)
66  * @author Matthew J. Duftler (duftler@us.ibm.com)
67  */

68 public class Constants
69 {
70   // Namespace prefixes.
71
public static final String JavaDoc NS_PRE_XMLNS = "xmlns";
72   public static final String JavaDoc NS_PRE_SOAP = "SOAP";
73   public static final String JavaDoc NS_PRE_SOAP_ENV = NS_PRE_SOAP + "-ENV";
74   public static final String JavaDoc NS_PRE_SOAP_ENC = NS_PRE_SOAP + "-ENC";
75   public static final String JavaDoc NS_PRE_SCHEMA_XSI = "xsi";
76   public static final String JavaDoc NS_PRE_SCHEMA_XSD = "xsd";
77
78   // Namespace URIs.
79
public static final String JavaDoc NS_URI_XMLNS =
80     "http://www.w3.org/2000/xmlns/";
81   public static final String JavaDoc NS_URI_SOAP_ENV =
82     "http://schemas.xmlsoap.org/soap/envelope/";
83   public static final String JavaDoc NS_URI_SOAP_ENC =
84     "http://schemas.xmlsoap.org/soap/encoding/";
85   
86   public static final String JavaDoc NS_URI_1999_SCHEMA_XSI =
87     "http://www.w3.org/1999/XMLSchema-instance";
88   public static final String JavaDoc NS_URI_1999_SCHEMA_XSD =
89     "http://www.w3.org/1999/XMLSchema";
90   public static final String JavaDoc NS_URI_2000_SCHEMA_XSI =
91     "http://www.w3.org/2000/10/XMLSchema-instance";
92   public static final String JavaDoc NS_URI_2000_SCHEMA_XSD =
93     "http://www.w3.org/2000/10/XMLSchema";
94   public static final String JavaDoc NS_URI_2001_SCHEMA_XSI =
95     "http://www.w3.org/2001/XMLSchema-instance";
96   public static final String JavaDoc NS_URI_2001_SCHEMA_XSD =
97     "http://www.w3.org/2001/XMLSchema";
98   public static final String JavaDoc NS_URI_CURRENT_SCHEMA_XSI =
99     NS_URI_2001_SCHEMA_XSI;
100   public static final String JavaDoc NS_URI_CURRENT_SCHEMA_XSD =
101     NS_URI_2001_SCHEMA_XSD;
102
103   public static final String JavaDoc NS_URI_XML_SOAP =
104     "http://xml.apache.org/xml-soap";
105   public static final String JavaDoc NS_URI_XML_SOAP_DEPLOYMENT =
106     "http://xml.apache.org/xml-soap/deployment";
107   public static final String JavaDoc NS_URI_LITERAL_XML =
108     "http://xml.apache.org/xml-soap/literalxml";
109   public static final String JavaDoc NS_URI_XMI_ENC =
110     "http://www.ibm.com/namespaces/xmi";
111
112   // HTTP header field names.
113
public static final String JavaDoc HEADER_POST = "POST";
114   public static final String JavaDoc HEADER_HOST = "Host";
115   public static final String JavaDoc HEADER_CONTENT_TYPE = "Content-Type";
116   public static final String JavaDoc HEADER_CONTENT_TYPE_JMS = "ContentType";
117   public static final String JavaDoc HEADER_CONTENT_LENGTH = "Content-Length";
118   public static final String JavaDoc HEADER_CONTENT_LOCATION = "Content-Location";
119   public static final String JavaDoc HEADER_CONTENT_ID = "Content-ID";
120   public static final String JavaDoc HEADER_SOAP_ACTION = "SOAPAction";
121   public static final String JavaDoc HEADER_AUTHORIZATION = "Authorization";
122   public static final String JavaDoc HEADER_PROXY_AUTHORIZATION =
123     "Proxy-Authorization";
124
125   // HTTP header field values.
126
public static final String JavaDoc HEADERVAL_DEFAULT_CHARSET = "iso-8859-1";
127   public static final String JavaDoc HEADERVAL_CHARSET_UTF8 = "utf-8";
128   public static final String JavaDoc HEADERVAL_CONTENT_TYPE = "text/xml";
129   public static final String JavaDoc HEADERVAL_CONTENT_TYPE_UTF8 =
130     HEADERVAL_CONTENT_TYPE + ";charset=" + HEADERVAL_CHARSET_UTF8;
131   public static final String JavaDoc HEADERVAL_CONTENT_TYPE_MULTIPART_PRIMARY =
132     "multipart";
133   public static final String JavaDoc HEADERVAL_MULTIPART_CONTENT_SUBTYPE = "related";
134   public static final String JavaDoc HEADERVAL_CONTENT_TYPE_MULTIPART =
135     HEADERVAL_CONTENT_TYPE_MULTIPART_PRIMARY + '/' +
136     HEADERVAL_MULTIPART_CONTENT_SUBTYPE;
137
138   // XML Declaration string
139
public static final String JavaDoc XML_DECL =
140     "<?xml version='1.0' encoding='UTF-8'?>\r\n";
141
142   // Element names.
143
public static final String JavaDoc ELEM_ENVELOPE = "Envelope";
144   public static final String JavaDoc ELEM_BODY = "Body";
145   public static final String JavaDoc ELEM_HEADER = "Header";
146   public static final String JavaDoc ELEM_FAULT = "Fault";
147   public static final String JavaDoc ELEM_FAULT_CODE = "faultcode";
148   public static final String JavaDoc ELEM_FAULT_STRING = "faultstring";
149   public static final String JavaDoc ELEM_FAULT_ACTOR = "faultactor";
150   public static final String JavaDoc ELEM_DETAIL = "detail";
151   public static final String JavaDoc ELEM_FAULT_DETAIL_ENTRY = "detailEntry";
152
153   // Qualified element names.
154
public static QName Q_ELEM_ENVELOPE =
155     new QName(NS_URI_SOAP_ENV, ELEM_ENVELOPE);
156   public static QName Q_ELEM_HEADER =
157     new QName(NS_URI_SOAP_ENV, ELEM_HEADER);
158   public static QName Q_ELEM_BODY =
159     new QName(NS_URI_SOAP_ENV, ELEM_BODY);
160   public static QName Q_ELEM_FAULT =
161     new QName(NS_URI_SOAP_ENV, ELEM_FAULT);
162
163   // Attribute names.
164
public static final String JavaDoc ATTR_ENCODING_STYLE = "encodingStyle";
165   public static final String JavaDoc ATTR_MUST_UNDERSTAND = "mustUnderstand";
166   public static final String JavaDoc ATTR_TYPE = "type";
167   public static final String JavaDoc ATTR_NULL = "null";
168   public static final String JavaDoc ATTR_NIL = "nil";
169   public static final String JavaDoc ATTR_ARRAY_TYPE = "arrayType";
170   public static final String JavaDoc ATTR_REFERENCE = "href";
171   public static final String JavaDoc ATTR_ID = "id";
172
173   // Qualified attribute names.
174
public static QName Q_ATTR_MUST_UNDERSTAND =
175     new QName(NS_URI_SOAP_ENV, ATTR_MUST_UNDERSTAND);
176
177   // Attribute values.
178
public static String JavaDoc ATTRVAL_TRUE = "true";
179
180   // SOAP defined fault codes.
181
public static String JavaDoc FAULT_CODE_VERSION_MISMATCH =
182     NS_PRE_SOAP_ENV + ":VersionMismatch";
183   public static String JavaDoc FAULT_CODE_MUST_UNDERSTAND =
184     NS_PRE_SOAP_ENV + ":MustUnderstand";
185   public static String JavaDoc FAULT_CODE_CLIENT = NS_PRE_SOAP_ENV + ":Client";
186   public static String JavaDoc FAULT_CODE_SERVER = NS_PRE_SOAP_ENV + ":Server";
187   public static String JavaDoc FAULT_CODE_PROTOCOL = NS_PRE_SOAP_ENV + ":Protocol";
188
189   // XML-SOAP implementation defined fault codes.
190
public static String JavaDoc FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI =
191       Constants.FAULT_CODE_SERVER + ".BadTargetObjectURI";
192
193   // Error messages.
194
public static String JavaDoc ERR_MSG_VERSION_MISMATCH =
195       FAULT_CODE_VERSION_MISMATCH +
196       ": Envelope element must " +
197       "be associated with " +
198       "the '" +
199       Constants.NS_URI_SOAP_ENV +
200       "' namespace.";
201
202   // Well-defined names for the 'bag' in SOAPContext
203
public static String JavaDoc BAG_HTTPSERVLET = "HttpServlet" ;
204   public static String JavaDoc BAG_HTTPSESSION = "HttpSession" ;
205   public static String JavaDoc BAG_HTTPSERVLETREQUEST = "HttpServletRequest" ;
206   public static String JavaDoc BAG_HTTPSERVLETRESPONSE = "HttpServletResponse" ;
207   public static String JavaDoc BAG_DEPLOYMENTDESCRIPTOR = "DeploymentDescriptor" ;
208
209   // Servlet init-parameter names.
210
public static final String JavaDoc ENVELOPE_EDITOR_FACTORY = "EnvelopeEditorFactory";
211   public static final String JavaDoc XML_PARSER = "XMLParser";
212   public static final String JavaDoc CONFIGFILENAME = "ConfigFile";
213
214   //////////////////////////////////////////////////////
215
// Type QNames for the various schemas
216
public static final QName string1999QName =
217     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "string");
218   public static final QName int1999QName =
219     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "int");
220   public static final QName decimal1999QName =
221     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "decimal");
222   public static final QName float1999QName =
223     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "float");
224   public static final QName double1999QName =
225     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "double");
226   public static final QName date1999QName =
227     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "date");
228   public static final QName boolean1999QName =
229     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "boolean");
230   public static final QName long1999QName =
231     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "long");
232   public static final QName short1999QName =
233     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "short");
234   public static final QName byte1999QName =
235     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "byte");
236   public static final QName hex1999QName =
237     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "hex");
238   public static final QName qName1999QName =
239     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "QName");
240   public static final QName timeInst1999QName =
241     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "timeInstant");
242   public static final QName object1999QName =
243     new QName(Constants.NS_URI_1999_SCHEMA_XSD, "ur-type");
244
245   public static final QName string2000QName =
246     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "string");
247   public static final QName int2000QName =
248     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "int");
249   public static final QName decimal2000QName =
250     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "decimal");
251   public static final QName float2000QName =
252     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "float");
253   public static final QName double2000QName =
254     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "double");
255   public static final QName date2000QName =
256     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "date");
257   public static final QName boolean2000QName =
258     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "boolean");
259   public static final QName long2000QName =
260     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "long");
261   public static final QName short2000QName =
262     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "short");
263   public static final QName byte2000QName =
264     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "byte");
265   public static final QName hex2000QName =
266     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "hex");
267   public static final QName qName2000QName =
268     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "QName");
269   public static final QName timeInst2000QName =
270     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "timeInstant");
271   public static final QName object2000QName =
272     new QName(Constants.NS_URI_2000_SCHEMA_XSD, "anyType");
273
274   public static final QName string2001QName =
275     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "string");
276   public static final QName int2001QName =
277     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "int");
278   public static final QName decimal2001QName =
279     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "decimal");
280   public static final QName float2001QName =
281     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "float");
282   public static final QName double2001QName =
283     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "double");
284   public static final QName date2001QName =
285     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "date");
286   public static final QName boolean2001QName =
287     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "boolean");
288   public static final QName long2001QName =
289     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "long");
290   public static final QName short2001QName =
291     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "short");
292   public static final QName byte2001QName =
293     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "byte");
294   public static final QName hex2001QName =
295     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "hexBinary");
296   public static final QName qName2001QName =
297     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "QName");
298   public static final QName timeInst2001QName =
299     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "dateTime");
300   public static final QName object2001QName =
301     new QName(Constants.NS_URI_2001_SCHEMA_XSD, "anyType");
302 }
303
Popular Tags