001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.wsdl;
019:
020: import java.util.HashMap;
021: import java.util.Map;
022: import javax.xml.namespace.QName;
023:
024: public final class WSDLConstants {
025:
026: public static final String WSDL_PREFIX = "wsdl";
027: public static final String WSDL11_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/";
028:
029: public static final String NP_XMLNS = "xmlns";
030: public static final String NU_XMLNS = "http://www.w3.org/2000/xmlns/";
031:
032: // XML Schema (CR) datatypes + structures
033: public static final String NP_SCHEMA_XSD = "xsd";
034: public static final String NU_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
035:
036: public static final QName SCHEMA_QNAME = new QName(NU_SCHEMA_XSD,
037: "schema");
038:
039: // XML Schema instance
040: public static final String NP_SCHEMA_XSI = "xsi";
041: public static final String NU_SCHEMA_XSI = "http://www.w3.org/2001/XMLSchema-instance";
042:
043: public static final String A_XSI_TYPE = "type";
044: public static final String A_XSI_NIL = "nil";
045:
046: // XML Schema attribute names
047: public static final QName NA_XSI_TYPE = new QName(NP_SCHEMA_XSI,
048: A_XSI_TYPE, NU_SCHEMA_XSI);
049: public static final QName NA_XSI_NIL = new QName(NP_SCHEMA_XSI,
050: A_XSI_NIL, NU_SCHEMA_XSI);
051:
052: public static final String SOAP11_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/soap/";
053: public static final String SOAP12_NAMESPACE = "http://schemas.xmlsoap.org/wsdl/soap12/";
054: public static final String SOAP11_PREFIX = "soap";
055: public static final String SOAP12_PREFIX = "soap12";
056:
057: public static final Map<String, String> NS_PREFIX_PAIR = new HashMap<String, String>(
058: 2);
059: static {
060: NS_PREFIX_PAIR.put(SOAP11_NAMESPACE, SOAP11_PREFIX);
061: NS_PREFIX_PAIR.put(SOAP12_NAMESPACE, SOAP12_PREFIX);
062: }
063:
064: public static final String NS_SOAP11_HTTP_BINDING = "http://schemas.xmlsoap.org/soap/http";
065:
066: public static final QName NS_SOAP_BINDING = new QName(
067: SOAP11_NAMESPACE, "binding");
068: public static final QName NS_SOAP_OPERATION = new QName(
069: SOAP11_NAMESPACE, "operation");
070: public static final QName NS_SOAP_BODY = new QName(
071: SOAP11_NAMESPACE, "body");
072: public static final QName NS_SOAP_FAULT = new QName(
073: SOAP11_NAMESPACE, "fault");
074: public static final QName NS_SOAP_BINDING_ADDRESS = new QName(
075: SOAP11_NAMESPACE, "address");
076:
077: public static final String SOAP12_HTTP_TRANSPORT = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
078:
079: public static final QName NS_SOAP12_BINDING = new QName(
080: SOAP12_NAMESPACE, "binding");
081: public static final QName NS_SOAP12_BINDING_ADDRESS = new QName(
082: SOAP12_NAMESPACE, "address");
083:
084: public static final String DOCUMENT = "document";
085: public static final String RPC = "rpc";
086: public static final String LITERAL = "literal";
087: public static final String REPLACE_WITH_ACTUAL_URL = "REPLACE_WITH_ACTUAL_URL";
088:
089: public static final String JMS_PREFIX = "jms";
090: public static final String TNS_PREFIX = "tns";
091:
092: // WSDL 1.1 definitions
093: public static final QName QNAME_BINDING = new QName(
094: WSDL11_NAMESPACE, "binding");
095: public static final QName QNAME_DEFINITIONS = new QName(
096: WSDL11_NAMESPACE, "definitions");
097: public static final QName QNAME_DOCUMENTATION = new QName(
098: WSDL11_NAMESPACE, "documentation");
099: public static final QName QNAME_IMPORT = new QName(
100: WSDL11_NAMESPACE, "import");
101: public static final QName QNAME_MESSAGE = new QName(
102: WSDL11_NAMESPACE, "message");
103: public static final QName QNAME_PART = new QName(WSDL11_NAMESPACE,
104: "part");
105: public static final QName QNAME_OPERATION = new QName(
106: WSDL11_NAMESPACE, "operation");
107: public static final QName QNAME_INPUT = new QName(WSDL11_NAMESPACE,
108: "input");
109: public static final QName QNAME_OUTPUT = new QName(
110: WSDL11_NAMESPACE, "output");
111:
112: public static final QName QNAME_PORT = new QName(WSDL11_NAMESPACE,
113: "port");
114: public static final QName QNAME_ADDRESS = new QName(
115: WSDL11_NAMESPACE, "address");
116: public static final QName QNAME_PORT_TYPE = new QName(
117: WSDL11_NAMESPACE, "portType");
118: public static final QName QNAME_FAULT = new QName(WSDL11_NAMESPACE,
119: "fault");
120: public static final QName QNAME_SERVICE = new QName(
121: WSDL11_NAMESPACE, "service");
122: public static final QName QNAME_TYPES = new QName(WSDL11_NAMESPACE,
123: "types");
124:
125: // WSDL Validation
126: public static final String ATTR_PART_ELEMENT = "element";
127: public static final String ATTR_PART_TYPE = "type";
128: public static final String ATTR_TYPE = "type";
129:
130: //For Stax2DOM getUserData(location)
131: public static final String NODE_LOCATION = "location";
132:
133: public static final int DOC_WRAPPED = 1;
134: public static final int DOC_BARE = 2;
135: public static final int RPC_WRAPPED = 3;
136: public static final int ERORR_STYLE_USE = -1;
137:
138: public static final String XML_BINDING_NS = "http://cxf.apache.org/bindings/xformat";
139: public static final QName NS_XMLHTTP_BINDING_ADDRESS = new QName(
140: "http://schemas.xmlsoap.org/wsdl/http/", "address");
141:
142: public static final String ATTR_TRANSPORT = "transport";
143: public static final String ATTR_LOCATION = "location";
144: public static final String ATTR_NAME = "name";
145: public static final String ATTR_TNS = "targetNamespace";
146:
147: public static final String WSDL11 = "1.1";
148: public static final String WSDL20 = "2.0";
149:
150: public enum WSDLVersion {
151: WSDL11, WSDL20, UNKNOWN
152: };
153:
154: private WSDLConstants() {
155: }
156:
157: public static WSDLVersion getVersion(String version) {
158: if (WSDL11.equals(version)) {
159: return WSDLVersion.WSDL11;
160: }
161: if (WSDL20.equals(version)) {
162: return WSDLVersion.WSDL20;
163: }
164: return WSDLVersion.UNKNOWN;
165: }
166:
167: }
|