Return-Path: Delivered-To: apmail-ws-woden-dev-archive@www.apache.org Received: (qmail 24518 invoked from network); 1 Sep 2009 05:54:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Sep 2009 05:54:53 -0000 Received: (qmail 94470 invoked by uid 500); 1 Sep 2009 05:54:53 -0000 Delivered-To: apmail-ws-woden-dev-archive@ws.apache.org Received: (qmail 94418 invoked by uid 500); 1 Sep 2009 05:54:53 -0000 Mailing-List: contact woden-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: woden-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list woden-dev@ws.apache.org Received: (qmail 94320 invoked by uid 500); 1 Sep 2009 05:54:53 -0000 Delivered-To: apmail-ws-woden-cvs@ws.apache.org Received: (qmail 94312 invoked by uid 99); 1 Sep 2009 05:54:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 05:54:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 05:54:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 90C48238890B; Tue, 1 Sep 2009 05:54:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r809835 [5/11] - in /webservices/woden/trunk/java/woden-api: ./ src/ src/main/ src/main/java/ src/main/java/javax/ src/main/java/javax/xml/ src/main/java/javax/xml/namespace/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/ap... Date: Tue, 01 Sep 2009 05:54:21 -0000 To: woden-cvs@ws.apache.org From: sagara@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090901055427.90C48238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocation.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,719 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.http; + +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Vector; + +import org.apache.woden.types.NCName; + +/** + * This class represents the {http location} extension property of the + * BindingOperation component which maps to the whttp:location + * extension attribute of the WSDL binding <operation> element, as defined by the + * WSDL 2.0 HTTP binding extensions. + *

+ * The value of the whttp:location attribute may contain templates in which elements + * from the instance data of the message to be serialized in the request IRI are cited by + * enclosing their local name within curly braces. + * A template can then be substituted by matching the local name against an element in the instance + * data and replacing the template in the HTTP Location with the String value of that element. + *

+ * For example, consider the HTTP Location "temperature/{town}" and the message data element + * <town>Sydney</town>. + * After substitution, the formatted HTTP Location is "temperature/Sydney". Note, that the entire + * template "{town}" is replaced by the matching element's value, "Sydney". + *

+ * If a template is not matched against the instance data, it is replaced in + * the formatted HTTP Location by the empty string (in other words, it is omitted). + *

+ * This class has one constructor and this takes a String representing a + * whttp:location value, which may contain the curly brace templates + * described above. + * The class can perform template substitution and return the formatted HTTP Location + * resulting from such substitution. It can also return the original HTTP Location + * value specified on the constructor, so that even after substitution it is possible to + * see where any templates were used. + *

+ * This class uses the EBNF grammar defined for {http location} by the + * WSDL 2.0 HTTP binding extensions to parse and validate the original HTTP Location string. + * It checks that any single left and right curly braces are correctly paired to enclose a String + * that is of the correct type to represent an element local name (that is, a String of type + * xs:NCName). + *

+ * It also supports the double curly brace syntax used to represent a literal single curly brace + * in the formatted HTTP Location. That is, a double curly brace escapes a literal single curly + * brace to avoid mistaking it for a template. For example, "abc{{def" is formatted as "abc{def" + * and this literal left brace is not interpreted as the beginning of a template. + * + * @author John Kaputin (jkaputin@apache.org) + */ +public class HTTPLocation { + + private String fOriginalLocation; + boolean fValid = true; + + private List fValidatedList = null; //used for validating the HTTP location string + private List fConsolidatedList = null; //used for substitution and formatting + + private static final String emptyString = "".intern(); + private static final String questionMark = "?".intern(); + private static final String leftBrace = "{".intern(); + private static final String rightBrace = "}".intern(); + private static final String doubleLeftBraces = "{{".intern(); + private static final String doubleRightBraces = "}}".intern(); + private static final String exclamatedLeftBrace = "{!".intern(); + + /** + * Creates an HTTPLocation object to represent the specified HTTP Location String value. + * This String is typically the value of the whttp:location attribute within + * a binding operation element. + *

+ * The location template String argument must not be null. + * + * @param location the String value of the http location + */ + public HTTPLocation(String location) { + fOriginalLocation = location; + + if(location == null) { + //TODO throw NPE with suitable error message + fValid = false; + } else if(location.equals(emptyString)) { + fValidatedList = new Vector(); + fValidatedList.add(emptyString); + fConsolidatedList = new Vector(); + fConsolidatedList.add(emptyString); + } else { + List tokenizedList = tokenizeLocation(); + validateTokens(tokenizedList); + if(fValid) { + consolidateTokens(); + } + } + } + + /** + * Indicates whether the original HTTP Location string used to create this object + * is valid. That is, whether it can be parse according to the EBNF grammar specified + * for the {http location} property by the WSDL 2.0 HTTP binding extensions. + * + * @return true if the format of the original HTTP location string is valid, + * otherwise false. + */ + public boolean isLocationValid() { + return fValid; + } + + /** + * Returns the original HTTP Location String specified when this object + * was created. + * + * @return the original HTTP Location String + */ + public String getOriginalLocation() { + return fOriginalLocation; + } + + /** + * Returns a formatted String representing the original HTTP Location modified by any + * template substitution that has taken place via the substitute methods. + * Templates that have not been matched against any element from the instance data + * will be omitted from the formatted String. + * An unmatched template is indicated by an HTTPLocationTemplate object whose value is null. + *

+ * If the original HTTP Location does not contain any templates then substitution + * is not applicable and this method will return the same String returned by the + * getOriginalLocation() method. + *

+ * If the HTTP Locationis invalid this method will return null. + * + * @return the formatted HTTP Location String, after any template substitution + */ + public String getFormattedLocation() { + if(!fValid) { + return null; + } + + StringBuffer buffer = new StringBuffer(); + Object currToken; + HTTPLocationTemplate template; + Iterator it = fConsolidatedList.iterator(); + + while(it.hasNext()) { + currToken = it.next(); + if(currToken instanceof HTTPLocationTemplate) { + template = (HTTPLocationTemplate)currToken; + String value = template.getValue(); + if(value != null) { + //the template is replaced in the HTTP Location by the matching element's value + buffer.append(value); + } + } else { + buffer.append(currToken); + } + } + + return buffer.toString(); + } + + /** + * Same behaviour as getFormattedLocation() + * + * @return the formatted HTTP Location String, after any template substitution + */ + public String toString() { + return getFormattedLocation(); + } + + /** + * Return the templates that appear in the HTTP Location string in + * the order they appear. + * If the HTTP Location contains no templates or if it is + * invalid this method will return an empty array. + * + * @return an array of HTTPLocationTemplate objects + */ + public HTTPLocationTemplate[] getTemplates() { + List templates = new Vector(); + + if(fValid) { + Iterator it = fConsolidatedList.iterator(); + while(it.hasNext()) { + Object next = it.next(); + if(next instanceof HTTPLocationTemplate) { + templates.add(next); + } + } + } + + HTTPLocationTemplate[] array = new HTTPLocationTemplate[templates.size()]; + templates.toArray(array); + return array; + } + + /** + * Return the templates that appear in the URI Path portion of the HTTP Location + * string in the order they appear. + * This is the portion before the first occurrence of '?'. + * If the HTTP Location contains no templates in the Path or if it is + * invalid this method will return an empty array. + * + * @return an array of HTTPLocationTemplate objects + */ + public HTTPLocationTemplate[] getTemplatesInPath() { + List templates = new Vector(); + + if(fValid) { + Iterator it = fConsolidatedList.iterator(); + while(it.hasNext()) { + Object next = it.next(); + if(next instanceof HTTPLocationTemplate) { + HTTPLocationTemplate template = (HTTPLocationTemplate)next; + if(!template.isQuery()) { + templates.add(next); + } + } + } + } + + HTTPLocationTemplate[] array = new HTTPLocationTemplate[templates.size()]; + templates.toArray(array); + return array; + } + + /** + * Return templates that appear in the URI Query portion of the HTTP Location + * string in the order they appear. + * This is the portion after the first occurrence of '?'. + * If the HTTP Location contains no templates in the Query or if it is + * invalid this method will return an empty array. + * + * @return an array of HTTPLocationTemplate objects + */ + public HTTPLocationTemplate[] getTemplatesInQuery() { + List templates = new Vector(); + + if(fValid) { + Iterator it = fConsolidatedList.iterator(); + while(it.hasNext()) { + Object next = it.next(); + if(next instanceof HTTPLocationTemplate) { + HTTPLocationTemplate template = (HTTPLocationTemplate)next; + if(template.isQuery()) { + templates.add(next); + } + } + } + } + + HTTPLocationTemplate[] array = new HTTPLocationTemplate[templates.size()]; + templates.toArray(array); + return array; + } + + /** + * Return the names of the templates that appear in the HTTP Location string + * in the order they appear. + * If the HTTP Location contains no templates or if it is + * invalid this method will return an empty array. + * + * @return a String array of template names + */ + public String[] getTemplateNames() { + List names = new Vector(); + + if(fValid) { + Iterator it = fConsolidatedList.iterator(); + while(it.hasNext()) { + Object next = it.next(); + if(next instanceof HTTPLocationTemplate) { + HTTPLocationTemplate template = (HTTPLocationTemplate)next; + names.add(template.getName()); + } + } + } + + String[] array = new String[names.size()]; + names.toArray(array); + return array; + } + + /** + * Return the names of the templates that appear in the URI Path portion of the + * HTTP Location string in the order they appear. + * This is the portion before the first occurrence of '?'. + * If the HTTP Location contains no templates in the Path or if it is + * invalid this method will return an empty array. + * + * @return a String array of template names + */ + public String[] getTemplateNamesInPath() { + List names = new Vector(); + + if(fValid) { + Iterator it = fConsolidatedList.iterator(); + while(it.hasNext()) { + Object next = it.next(); + if(next instanceof HTTPLocationTemplate) { + HTTPLocationTemplate template = (HTTPLocationTemplate)next; + if(!template.isQuery()) { + names.add(template.getName()); + } + } + } + } + + String[] array = new String[names.size()]; + names.toArray(array); + return array; + } + + /** + * Return the names of the templates that appear in the URI Query portion of the + * HTTP Location string in the order they appear. + * This is the portion after the first occurrence of '?'. + * If the HTTP Location contains no templates in the Query or if it is + * invalid this method will return an empty array. + * + * @return a String array of template names + */ + public String[] getTemplateNamesInQuery() { + List names = new Vector(); + + if(fValid) { + Iterator it = fConsolidatedList.iterator(); + while(it.hasNext()) { + Object next = it.next(); + if(next instanceof HTTPLocationTemplate) { + HTTPLocationTemplate template = (HTTPLocationTemplate)next; + if(template.isQuery()) { + names.add(template.getName()); + } + } + } + } + + String[] array = new String[names.size()]; + names.toArray(array); + return array; + } + + /** + * Return the first template with the specified name from the HTTP Location string + * or null if no such template is exists. + *

+ * If the HTTP Location is invalid this method will return null. + * + * @return an HTTPLocationTemplate with the specified name + */ + public HTTPLocationTemplate getTemplate(String name) { + if(!fValid) { + return null; + } + + HTTPLocationTemplate namedTemplate = null; + if(name != null) { + HTTPLocationTemplate[] templates = getTemplates(); + for(int i=0; i + * If the HTTP Location is invalid this method will return null. + * + * @return an HTTPLocationTemplate with the specified name + */ + public HTTPLocationTemplate getTemplateInPath(String name) { + if(!fValid) { + return null; + } + + HTTPLocationTemplate namedTemplate = null; + if(name != null) { + HTTPLocationTemplate[] templates = getTemplatesInPath(); + for(int i=0; i + * If the HTTP Location is invalid this method will return null. + * + * @return an HTTPLocationTemplate with the specified name + */ + public HTTPLocationTemplate getTemplateInQuery(String name) { + if(!fValid) { + return null; + } + + HTTPLocationTemplate namedTemplate = null; + if(name != null) { + HTTPLocationTemplate[] templates = getTemplatesInQuery(); + for(int i=0; i 0) { + tokens.add(buffer.toString()); + buffer = new StringBuffer(); + } + questionMarkFound = true; + tokens.add(questionMark); + } else if(currChar == '{') { + if(buffer.length() > 0) { + tokens.add(buffer.toString()); + buffer = new StringBuffer(); + } + if(i < lastPos && fOriginalLocation.charAt(i+1) == '{') { + tokens.add(doubleLeftBraces); + i++; //move scan position to the 2nd left curly brace + } else if(i < lastPos && fOriginalLocation.charAt(i+1) == '!') { + tokens.add(exclamatedLeftBrace); + i++; //move scan position to the exclamation mark + } else { + tokens.add(leftBrace); + } + } else if(currChar == '}') { + if(buffer.length() > 0) { + tokens.add(buffer.toString()); + buffer = new StringBuffer(); + } + if(i < lastPos && fOriginalLocation.charAt(i+1) == '}') { + tokens.add(doubleRightBraces); + i++; //move scan position to the 2nd right curly brace + } else { + tokens.add(rightBrace); + } + + } else { + buffer.append(currChar); + } + } + + if(buffer.length() > 0) { + tokens.add(buffer.toString()); + } + + return tokens; + } + + /* + * The EBNF grammar defined for HTTP Location in WSDL 2.0 spec Part2 Section 6.8.1.1 is: + * + * httpLocation ::= charData? (( openBrace | closeBrace | template ) charData?)* + * charData ::= [^{}]* + * openBrace ::= '{{' + * closeBrace ::= '}}' + * template ::= rawTemplate | encodedTemplate + * rawTemplate ::= '{!' NCName '}' + * encodedTemplate ::= '{' NCName '}' + * + * The input to this method is an ordered list consisting of the following tokens parsed + * from the original HTTP Location string: '{{', '}}', '{!', '{', '}', first occurrence of ?, + * any other string. + * + * This method will validate these tokens according to the EBNF grammar above. That is, + * it will do the following checks in order against each token, stopping and moving on + * to the next token if any check is satisfied: + * 1) check for a '?' indicating the start of the URI Query string + * 2) check for the openBrace '{{' + * 3) check for the closeBrace '}}' + * 4) check for a rawTemplate, based on the sequence of tokens '{!', NCName, '}' + * 5) check for an encodedTemplate, based on the sequence of tokens '{', NCName, '}' + * 6) check that any remaining string is valid charData (has no curly braces). + * + * Encoded templates have a matching pairs of left and right curly braces "{...}". + * Raw templates have an exclamated left brace and a right brace "{!...}". + * The NCName string in a raw or encoded template must be of type xs:NCName + * (that is, xs:NCName is the type defined for the local name of an XML element). + * + * Valid tokens will be copied to a 'validated' list. The tokens comprising any raw or encoded + * templates identified at steps 3) or 4) will be replaced in this new list by + * HTTPLocationTemplate objects. + * + * If an error is found, the HTTP Location will be flagged as invalid and no formatted location + * or templates will be available. + */ + private void validateTokens(List tokenizedList) { + + List tokens = new Vector(); + Object currToken; + String nextToken; + Object nextNextToken; + int size = tokenizedList.size(); + ListIterator it = tokenizedList.listIterator(); + boolean isQuery = false; + + while(fValid && it.hasNext()) { + currToken = it.next(); + int currIndex = it.previousIndex(); + + if(currToken == questionMark) { + // 1) check for a '?' indicating the start of the URI Query string + isQuery = true; + tokens.add(questionMark); + } else if(currToken == doubleLeftBraces || currToken == doubleRightBraces) { + // 2) check for the openBrace '{{' + // 3) check for the closeBrace '}}' + tokens.add(currToken); + } else if(currToken == leftBrace || currToken == exclamatedLeftBrace) { + // 4) check for a rawTemplate, based on the sequence of tokens '{!', NCName, '}' + // 5) check for an encodedTemplate, based on the sequence of tokens '{', NCName, '}' + if(size-currIndex < 3) { + fValid = false; //this token is not followed by two further tokens + } else { + nextToken = (String)it.next(); + nextNextToken = it.next(); + if(NCName.isValid(nextToken) && nextNextToken == rightBrace) { + boolean isEncoded = (currToken == leftBrace); + HTTPLocationTemplate template = + new HTTPLocationTemplate(nextToken, isEncoded, isQuery); + tokens.add(template); + } else { + fValid = false; //we don't have a valid template + } + } + } else { + // 6) check that any other type of token is valid charData (has no curly braces). + String s = (String)currToken; + int index = s.indexOf(leftBrace); + if(index < 0) { + index = s.indexOf(rightBrace); + } + if(index >= 0) { + fValid = false; //contains unmatched curly braces + } else { + tokens.add(currToken); + } + } + } //end while loop + + if(fValid) { + fValidatedList = tokens; + } + } + + /* + * Consolidate the validated tokens parsed from the HTTP Location string, into a list containing + * only HTTPLocationTemplate objects, literal single braces or Strings representing any other + * HTTP Location content. This consolidated list will be used for template substitution + * and for producing an external representation of the HTTP Location string, formatted with the + * substituted values. + * Note, any double curly braces will be replaced by a literal single brace. + */ + private void consolidateTokens() { + + StringBuffer buffer = new StringBuffer(); + Object currToken; + List tokens = new Vector(); + Iterator it = fValidatedList.iterator(); + + while(it.hasNext()) { + currToken = it.next(); + if(currToken instanceof HTTPLocationTemplate) { + //Output any previously concatentated string content then output this template's value. + if(buffer.length() > 0) { + tokens.add(buffer.toString()); + buffer = new StringBuffer(); + } + tokens.add(currToken); + } else if(currToken == doubleLeftBraces) { + buffer.append(leftBrace); + } else if(currToken == doubleRightBraces) { + buffer.append(rightBrace); + } else { + //concatentate this token to previous string content + buffer.append(currToken); + } + } + + if(buffer.length() > 0) { + tokens.add(buffer.toString()); + } + + fConsolidatedList = tokens; + } + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/http/HTTPLocationTemplate.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,137 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.http; + + +/** + * This class represents a template specified within the HTTP Location string used as the value + * of the whttp:location extension attribute. The template cites an element from + * the instance data of the message to be serialized in the request IRI by enclosing the element's + * local name in curly braces. The template is then matched against an element in the instance + * data and replaced in the HTTP Location string by that element's String value. + *

+ * For example, the template "{postcode}" is matched to the instance data element + * <postcode>90210</postcode> and the String value "90210" replaces "{postcode}" + * in the formatted HTTP Location string. + *

+ * The WSDL 2.0 HTTP binding extension requires certain encoding be performed on the content of + * the HTTP Location string. Templates of the form "{localname}" are called encoded + * templates because these encoding rules also apply to any element values substituted + * for these templates. A raw template is used to indicate that encoding is not to + * be performed on the substituted value. Raw templates are identified by the exclamated curly + * brace syntax "{!localname}". + *

+ * A template that appears in the HTTP Location String before the first occurrence of '?' is + * in the URI Path portion of the HTTP Location. One that appears after the first occurrence of + * '?' is in the URI Query portion. + *

+ * This class has a single constructor which takes three parameters that indicate the local name + * of the element cited in the template, whether the template is encoded and whether it appears + * in the Query portion of the HTTP Location. + *

+ * The class has the following characteristics: + *

    + *
  • + * It returns the element local name cited by the template. + *
  • + *
  • + * It does not permit the cited element name to be modified. + *
  • + *
  • + * It accepts a String value for the element cited by the template. + *
  • + *
  • + * It differentiates an encoded template from a raw template. + *
  • + *
  • + * It differentiates a template that appears in the Path from one that appears in the Query. + *
  • + *
+ * + * @author John Kaputin (jkaputin@apache.org) + */ +public class HTTPLocationTemplate { + + private String fName; + private String fValue = null; + private boolean fIsEncoded; + private boolean fIsQuery; + + /** + * Creates an HTTP Location template that cites the specified element. The three parameters must + * be specified, they cannot be null. + * + * @param name a String representing the local name of the element cited by this template. + * @param isEncoded a boolean value 'true' if it is an encoded template or 'false' if it is a + * raw template. + * @param isQuery a boolean value 'true' if the template appears in the URI Query portion of the + * HTTP Location string or 'false' if it appears in the URI Path. + * So 'true' means it appears after first occurrence of '?'. + */ + public HTTPLocationTemplate(String name, boolean isEncoded, boolean isQuery) { + + //TODO - check syntax, not null, not empty string...throw IllegalArgExc + + fName = name; + fIsEncoded = isEncoded; + fIsQuery = isQuery; + } + + /** + * Returns a String representing the local name of the element cited by this template. + */ + public String getName() { + return fName; + } + + /** + * Returns a String representing the value of the element cited by this template. + */ + public String getValue() { + return fValue; + } + + /** + * Sets the String value of the element cited by this template. This is the String + * substituted for the template in the formatted HTTP Location string. + * + * @param value the cited element's String value + */ + public void setValue(String value) { + fValue = value; + } + + /** + * Returns 'true' if the template is encoded, otherwise 'false'. + * That is, 'true' if it is of the form "{localname}". + * So, 'false' indicates a 'raw' template of the form "{!localname}". + */ + public boolean isEncoded() { + return fIsEncoded; + } + + /** + * Returns 'true' if the template appears in the URI Query portion of the HTTP Location string, + * otherwise false. That is, 'true' if it appears after the first occurrence of '?'. + * So, 'false' indicates a template that appears in the URI Path portion of the HTTP Location + * string. + */ + public boolean isQuery() { + return fIsQuery; + } + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Argument.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Argument.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Argument.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Argument.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,52 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.woden.wsdl20.extensions.rpc; + +import javax.xml.namespace.QName; + +/** + * Argument represents a (name,direction) pair where + * name is the name of an argument and direction is its direction + * as defined in Part 2: Adjuncts. + * + * @author Arthur Ryman (ryman@ca.ibm.com) + * + */ +public class Argument { + + private QName name; + + private Direction direction; + + public Argument(QName name, Direction direction) { + + this.name = name; + this.direction = direction; + } + + public QName getName() { + + return name; + } + + public Direction getDirection() { + + return direction; + } +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Direction.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Direction.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Direction.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/Direction.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,45 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.woden.wsdl20.extensions.rpc; + +/** + * Direction is a typesafe enumeration of the four + * possible values, #in, #out, #inout, and #return. + * + * @author Arthur Ryman (ryman@ca.ibm.com) + */ + +public class Direction { + + private String token; + + private Direction(String token) { + + this.token = token; + } + + public static final Direction IN = new Direction("#in"); + public static final Direction OUT = new Direction("#out"); + public static final Direction INOUT = new Direction("#inout"); + public static final Direction RETURN = new Direction("#return"); + + public String toString() { + + return token; + } +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCConstants.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCConstants.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCConstants.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCConstants.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.rpc; + +import java.net.URI; + +import javax.xml.namespace.QName; + +public class RPCConstants { + + // Extension namespace + public static final String NS_STRING_RPC = "http://www.w3.org/ns/wsdl/rpc"; + public static final URI NS_URI_RPC = URI.create(NS_STRING_RPC); + + // Style + public static final String STYLE_STRING_RPC = "http://www.w3.org/ns/wsdl/style/rpc"; + public static final URI STYLE_URI_RPC = URI.create(STYLE_STRING_RPC); + + // Extension namespace prefix + public static final String PFX_WRPC = "wrpc"; + + // Extension attribute names + public static final String ATTR_SIGNATURE = "signature"; + + // Extension attribute QNames + public static final QName Q_ATTR_RPC_SIGNATURE = new QName(NS_STRING_RPC, ATTR_SIGNATURE, PFX_WRPC); + + // Extension property names + public static final String PROP_RPC_SIGNATURE = "rpc signature"; +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCInterfaceOperationExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCInterfaceOperationExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCInterfaceOperationExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/rpc/RPCInterfaceOperationExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,57 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.woden.wsdl20.extensions.rpc; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; + +/** + * RPCInterfaceOperationExtensions represents the WSDL 2.0 predefined + * RPC extensions, as specified in the WSDL 2.0 Part 2: Adjuncts specification, + * for the Interface Operation component. + *

+ * Provides access to the extension properties of the Interface Operation component + * that are in the http://www.w3.org/ns/wsdl/rpc namespace. + * These extension properties can be accessed as ExtensionProperty objects + * via the getProperties and getProperty methods + * using the property names and Java types shown in the following table. + *

+ * + * + * + * + * + * + * + * + * + *
Property nameJava type
rpc signatureorg.apache.woden.wsdl20.extensions.rpc.Argument[]
+ *

+ * In addition to the getProperties and getProperty methods, + * this interface defines accessor methods specific to each extension property. + * + * @author Arthur Ryman (ryman@ca.ibm.com) + * + */ +public interface RPCInterfaceOperationExtensions extends ComponentExtensionContext { + + /** + * Returns the {rpc signature} extension property of Interface Operation + * as defined by the wrpc:signature attribute. + */ + public Argument[] getRPCSignature(); +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,106 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import java.net.URI; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; + +/** + * Provides access to the extension properties of the Binding component + * that are in the http://www.w3.org/ns/wsdl/soap namespace. + * These extension properties can be accessed as ExtensionProperty objects + * via the getProperties and getProperty methods + * using the property names and Java types shown in the following table. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Property nameJava type
soap versionjava.lang.String
soap underlying protocoljava.net.URI
soap mep defaultjava.net.URI
soap modulesorg.apache.woden.wsdl20.extensions.soap.SOAPModule[]
+ *

+ * In addition to the getProperties and getProperty methods, + * this interface defines accessor methods specific to each SOAP extension property. + * It also provides accessor methods for some additional HTTP extension properties + * that are present in a SOAP binding when the underlying protocol is HTTP. + *

+ * These are: + *

    + *
  • {http query parameter separator default}
  • + *
  • {http cookies}
  • + *
  • {http content encoding default}
  • + *
+ *

+ * TODO Re HTTP methods, consider WODEN-158 which proposes keeping extension interfaces namespace-specific, not binding-type-specific + * + * @author John Kaputin (jkaputin@apache.org) + */ +public interface SOAPBindingExtensions extends ComponentExtensionContext +{ + public String getSoapVersion(); + + public URI getSoapUnderlyingProtocol(); + + public URI getSoapMepDefault(); + + public SOAPModule[] getSoapModules(); + + /** + * If the SOAP version is "1.1" or "1.2" and the underlying protocol is HTTP, returns the + * {http query parameter separator default} extension property represented by the + * whttp:queryParameterSeparatorDefault extension attribute , otherwise null. + * + * @return String the {http query parameter separator default} extension property + */ + public String getHttpQueryParameterSeparatorDefault(); + + /** + * If the SOAP version is "1.1" or "1.2" and the underlying protocol is HTTP, returns the + * {http cookies} extension property represented by the + * whttp:cookies extension attribute , otherwise null. + * + * @return Boolean the {http cookies} extension property if present, otherwise null + */ + public Boolean isHttpCookies(); + + /** + * If the SOAP version is "1.1" or "1.2" and the underlying protocol is HTTP, returns the + * {http content encoding default} extension property represented by the + * whttp:contentEncodingDefault extension attribute , otherwise null. + * + * @return String the {http content encoding default} extension property + */ + public String getHttpContentEncodingDefault(); + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,89 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; +import org.apache.woden.wsdl20.extensions.http.HTTPHeader; + +/** + * Provides access to the extension properties of the Binding Fault component + * that are in the http://www.w3.org/ns/wsdl/soap namespace. + * These extension properties can be accessed as ExtensionProperty objects + * via the getProperties and getProperty methods + * using the property names and Java types shown in the following table. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Property nameJava type
soap fault codeorg.apache.woden.wsdl20.extensions.soap.SOAPFaultCode
soap fault subcodesorg.apache.woden.wsdl20.extensions.soap.SOAPFaultSubcodes
soap modulesorg.apache.woden.wsdl20.extensions.soap.SOAPModule[]
soap headersorg.apache.woden.wsdl20.extensions.soap.SOAPHeaderBlock[]
+ *

+ * In addition to the getProperties and getProperty methods, + * this interface defines accessor methods specific to each SOAP extension property. + * It also provides accessor methods for some additional HTTP extension properties + * that are present in a SOAP binding when the underlying protocol is HTTP. + *

+ * These are: + *

    + *
  • {http content encoding}
  • + *
  • {http headers}
  • + *
+ *

+ * TODO Re HTTP methods, consider WODEN-158 which proposes keeping extension interfaces namespace-specific, not binding-type-specific + * + * @author John Kaputin (jkaputin@apache.org) + */ +public interface SOAPBindingFaultExtensions extends ComponentExtensionContext +{ + /** + * Returns an object representing the {soap fault code} property, which may + * contain either an xs:QName or the xs:token "#any". + */ + public SOAPFaultCode getSoapFaultCode(); + + /** + * Returns an object representing the {soap fault subcodes} property, + * which contains a List of xs:QName or the xs:token "#any". + */ + public SOAPFaultSubcodes getSoapFaultSubcodes(); + + public SOAPModule[] getSoapModules(); + + public SOAPHeaderBlock[] getSoapHeaders(); + + public String getHttpContentEncoding(); + + public HTTPHeader[] getHttpHeaders(); + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultReferenceExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultReferenceExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultReferenceExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingFaultReferenceExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; + +/** + * Provides access to the extension properties of the Binding Fault Reference component + * that are in the http://www.w3.org/ns/wsdl/soap namespace. + * These extension properties can be accessed as ExtensionProperty objects + * via the getProperties and getProperty methods + * using the property names and Java types shown in the following table. + *

+ * + * + * + * + * + * + * + * + * + *
Property nameJava type
soap modulesorg.apache.woden.wsdl20.extensions.soap.SOAPModule[]
+ *

+ * In addition to the getProperties and getProperty methods, + * this interface defines accessor methods specific to each SOAP extension property. + * + * @author John Kaputin (jkaputin@apache.org) + */ +public interface SOAPBindingFaultReferenceExtensions extends ComponentExtensionContext +{ + public SOAPModule[] getSoapModules(); +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingMessageReferenceExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,76 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; +import org.apache.woden.wsdl20.extensions.http.HTTPHeader; + +/** + * Provides access to the extension properties of the Binding Message Reference component + * that are in the http://www.w3.org/ns/wsdl/soap namespace. + * These extension properties can be accessed as ExtensionProperty objects + * via the getProperties and getProperty methods + * using the property names and Java types shown in the following table. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + *
Property nameJava type
soap modulesorg.apache.woden.wsdl20.extensions.soap.SOAPModule[]
soap headersorg.apache.woden.wsdl20.extensions.soap.SOAPHeaderBlock[]
+ *

+ * In addition to the getProperties and getProperty methods, + * this interface defines accessor methods specific to each SOAP extension property. + * It also provides accessor methods for some additional HTTP extension properties + * that are present in a SOAP binding when the underlying protocol is HTTP. + *

+ * These are: + *

    + *
  • {http content encoding}
  • + *
  • {http headers}
  • + *
+ *

+ * TODO Re HTTP methods, consider WODEN-158 which proposes keeping extension interfaces namespace-specific, not binding-type-specific + * + * @author John Kaputin (jkaputin@apache.org) + */ +public interface SOAPBindingMessageReferenceExtensions extends ComponentExtensionContext +{ + public SOAPModule[] getSoapModules(); + + public SOAPHeaderBlock[] getSoapHeaders(); + + /** + * @return String the {http content encoding} property, represented by the whttp:contentEncoding extension attribute + */ + public String getHttpContentEncoding(); + + /** + * @return HTTPHeader[] the {http headers} property, represented by an array of + * HTTPHeader extension components, which map to whttp:header elements. + */ + public HTTPHeader[] getHttpHeaders(); + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingOperationExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingOperationExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingOperationExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPBindingOperationExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,109 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import java.net.URI; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; +import org.apache.woden.wsdl20.extensions.http.HTTPLocation; + +/** + * Provides access to the extension properties of the Binding Operation component + * that are in the http://www.w3.org/ns/wsdl/soap namespace. + * These extension properties can be accessed as ExtensionProperty objects + * via the getProperties and getProperty methods + * using the property names and Java types shown in the following table. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Property nameJava type
soap mepjava.net.URI
soap actionjava.net.URI
soap modulesorg.apache.woden.wsdl20.extensions.soap.SOAPModule[]
+ *

+ * In addition to the getProperties and getProperty methods, + * this interface defines accessor methods specific to each SOAP extension property. + * It also provides accessor methods for some additional HTTP extension properties + * that are present in a SOAP binding when the underlying protocol is HTTP. + *

+ * These are: + *

    + *
  • {http location}
  • + *
  • {http query parameter separator}
  • + *
  • {http content encoding default}
  • + *
+ *

+ * TODO Re HTTP methods, consider WODEN-158 which proposes keeping extension interfaces namespace-specific, not binding-type-specific + * + * @author John Kaputin (jkaputin@apache.org) + */ +public interface SOAPBindingOperationExtensions extends ComponentExtensionContext +{ + /** + * Returns an object representing the {soap mep} property, of type xs:anyURI. + */ + public URI getSoapMep(); + + /** + * Returns an object representing the {soap action} property, of type xs:anyURI. + */ + public URI getSoapAction(); + + /** + * Returns an array representing the {soap modules} property, of type wsoap:module. + */ + public SOAPModule[] getSoapModules(); + + /** + * If the SOAP version is "1.1" or "1.2" and the underlying protocol is HTTP, returns the + * {http location} extension property represented by the + * whttp:location extension attribute , otherwise null. + * + * @return HTTPLocation the {http location} extension property + */ + public HTTPLocation getHttpLocation(); + + /** + * If the SOAP version is "1.1" or "1.2" and the underlying protocol is HTTP, returns the + * {http query parameter separator} extension property represented by the + * whttp:queryParameterSeparator extension attribute , otherwise null. + * + * @return String the {http query parameter separator} extension property + */ + public String getHttpQueryParameterSeparator(); + + /** + * If the SOAP version is "1.1" or "1.2" and the underlying protocol is HTTP, returns the + * {http content encoding default} extension property represented by the + * whttp:contentEncodingDefault extension attribute , otherwise null. + * + * @return String the {http content encoding default} extension property + */ + public String getHttpContentEncodingDefault(); + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPConstants.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPConstants.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPConstants.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPConstants.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,81 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import java.net.URI; + +import javax.xml.namespace.QName; + +public class SOAPConstants { + + // Extension namespace + public static final String NS_STRING_SOAP = "http://www.w3.org/ns/wsdl/soap"; + public static final URI NS_URI_SOAP = URI.create(NS_STRING_SOAP); + + // Extension namespace prefix + public static final String PFX_WSOAP = "wsoap"; + + // Extension element names. + public static final String ELEM_HEADER = "header"; + public static final String ELEM_MODULE = "module"; + + // Extension attribute names + public static final String ATTR_ACTION = "action"; + public static final String ATTR_CODE = "code"; + public static final String ATTR_MEP = "mep"; + public static final String ATTR_MEPDEFAULT = "mepDefault"; + public static final String ATTR_MUSTUNDERSTAND = "mustUnderstand"; + public static final String ATTR_PROTOCOL = "protocol"; + public static final String ATTR_SUBCODES = "subcodes"; + public static final String ATTR_VERSION = "version"; + + // Extension element QNames + public static final QName Q_ELEM_SOAP_HEADER = new QName(NS_STRING_SOAP, ELEM_HEADER, PFX_WSOAP); + public static final QName Q_ELEM_SOAP_MODULE = new QName(NS_STRING_SOAP, ELEM_MODULE, PFX_WSOAP); + + // Extension attribute QNames + public static final QName Q_ATTR_SOAP_ACTION = new QName(NS_STRING_SOAP, ATTR_ACTION, PFX_WSOAP); + public static final QName Q_ATTR_SOAP_CODE = new QName(NS_STRING_SOAP, ATTR_CODE, PFX_WSOAP); + public static final QName Q_ATTR_SOAP_MEP = new QName(NS_STRING_SOAP, ATTR_MEP, PFX_WSOAP); + public static final QName Q_ATTR_SOAP_MEPDEFAULT = new QName(NS_STRING_SOAP, ATTR_MEPDEFAULT, PFX_WSOAP); + public static final QName Q_ATTR_SOAP_PROTOCOL = new QName(NS_STRING_SOAP, ATTR_PROTOCOL, PFX_WSOAP); + public static final QName Q_ATTR_SOAP_SUBCODES = new QName(NS_STRING_SOAP, ATTR_SUBCODES, PFX_WSOAP); + public static final QName Q_ATTR_SOAP_VERSION = new QName(NS_STRING_SOAP, ATTR_VERSION, PFX_WSOAP); + + // Extension property names + public static final String PROP_SOAP_ACTION = "soap action"; + public static final String PROP_SOAP_FAULT_CODE = "soap fault code"; + public static final String PROP_SOAP_FAULT_SUBCODES = "soap fault subcodes"; + public static final String PROP_SOAP_HEADERS = "soap headers"; + public static final String PROP_SOAP_MEP = "soap mep"; + public static final String PROP_SOAP_MEP_DEFAULT = "soap mep default"; + public static final String PROP_SOAP_MODULES = "soap modules"; + public static final String PROP_SOAP_UNDERLYING_PROTOCOL = "soap underlying protocol"; + public static final String PROP_SOAP_VERSION = "soap version"; + + // Protocol values + public static final String PROTOCOL_STRING_SOAP11_HTTP = "http://www.w3.org/2006/01/soap11/bindings/HTTP/"; + public static final String PROTOCOL_STRING_SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/"; + public static final URI PROTOCOL_URI_SOAP11_HTTP = URI.create(PROTOCOL_STRING_SOAP11_HTTP); + public static final URI PROTOCOL_URI_SOAP12_HTTP = URI.create(PROTOCOL_STRING_SOAP12_HTTP); + + // Version values + public static final String VERSION_1_1 = "1.1"; + public static final String VERSION_1_2 = "1.2"; + + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPEndpointExtensions.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,73 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import org.apache.woden.wsdl20.extensions.ComponentExtensionContext; +import org.apache.woden.wsdl20.extensions.http.HTTPAuthenticationScheme; + +/** + * There are no WSDL 2.0 SOAP extension properties (from the namespace + * http://www.w3.org/ns/wsdl/soap) attached to the Endpoint component. + *

+ * The purpose of this interface is to maintain consistency across the + * WSDL 2.0 SOAP extensions in Woden, which define accessor methods for the + * HTTP properties that are added to WSDL 2.0 components, along with + * the SOAP properties, when a SOAP binding specifies HTTP as the underlying + * protocol. + *

+ * For this interface, the generic ExtensionProperty accessor methods, + * getProperties and getProperty, return null + * (because they only apply to SOAP extension properties, which are not present + * for the Endpoint component). + *

+ * This interface defines additional extension-specific accessor methods for the + * HTTP extension properties that are added to the Endpoint component by a SOAP binding + * when the underlying protocol is HTTP. + *

+ * These are: + *

    + *
  • {http authentication scheme}
  • + *
  • {http authentication realm}
  • + *
+ *

+ * TODO Re HTTP methods, consider WODEN-158 which proposes keeping extension interfaces namespace-specific, not binding-type-specific + * + * @author Arthur Ryman (ryman@ca.ibm.com, arthur.ryman@gmail.com) + * + */ +public interface SOAPEndpointExtensions extends ComponentExtensionContext { + + /** + * If the SOAP binding specifies HTTP as the underlying protocol, the + * {http authentication scheme} property is added to the Endpoint component + * and it will be returned by this method. + * If the underlying protocol is not HTTP, this method will return null. + * + * @return the HTTPAuthenticationScheme if present, otherwise null + */ + public HTTPAuthenticationScheme getHttpAuthenticationScheme(); + + /** + * If the SOAP binding specifies HTTP as the underlying protocol, the + * {http authentication realm} property is added to the Endpoint component + * and it will be returned by this method. + * If the underlying protocol is not HTTP, this method will return null. + * + * @return a String representing the {http authentication realm} property if present, otherwise null. + */ + public String getHttpAuthenticationRealm(); +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultCode.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultCode.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultCode.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultCode.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,58 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import javax.xml.namespace.QName; + +/** + * This class represents the {soap fault code} property that forms part of the + * SOAP extensions to the WSDL BindingFault component. + * This property may contain either a QName representing the code or the xs:token #any. + *

+ * This class will restrict the possible values to a QName reference or the string "#any". + * It provides methods to query whether the property contains a QName or a token and + * methods to retrieve the property value of the appropriate type. + * + * @author jkaputin@apache.org + */ +public class SOAPFaultCode +{ + private final String fToken; + private final QName fCodeQN; + public static final SOAPFaultCode ANY = new SOAPFaultCode("#any"); + + private SOAPFaultCode(String token) + { + fToken = token; + fCodeQN = null; + } + + public SOAPFaultCode(QName codeQN) + { + fToken = null; + fCodeQN = codeQN; + } + + public boolean isQName() {return fCodeQN != null;} + + public boolean isToken() {return fToken != null;} + + public QName getQName() {return fCodeQN;} + + public String getToken() {return fToken;} + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultSubcodes.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultSubcodes.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultSubcodes.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPFaultSubcodes.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,59 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import javax.xml.namespace.QName; + +/** + * This class represents the {soap fault subcodes} property that forms part of the + * SOAP extensions to the WSDL BindingFault component. + * This property may contain either a list of QNames representing the subcodes or + * the xs:token #any. + *

+ * This class will restrict the possible values to a collection of QNames or the string "#any". + * It provides methods to query whether the property contains QNames or a token and + * methods to retrieve the property value of the appropriate type. + * + * @author jkaputin@apache.org + */ +public class SOAPFaultSubcodes +{ + private final String fToken; + private final QName[] fSubcodeQNs; + public static final SOAPFaultSubcodes ANY = new SOAPFaultSubcodes("#any"); + + private SOAPFaultSubcodes(String token) + { + fToken = token; + fSubcodeQNs = new QName[0]; + } + + public SOAPFaultSubcodes(QName[] subcodeQNs) + { + fToken = null; + fSubcodeQNs = subcodeQNs; + } + + public boolean isQNames() {return fSubcodeQNs.length > 0;} + + public boolean isToken() {return fToken != null;} + + public QName[] getQNames() {return fSubcodeQNs;} + + public String getToken() {return fToken;} + +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlock.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlock.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlock.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlock.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,40 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import org.apache.woden.wsdl20.ElementDeclaration; +import org.apache.woden.wsdl20.WSDLComponent; + +/** + * This interface represents the SOAPHeaderBlock Component that can appear in the + * optional {soap headers} property of the WSDL 2.0 components BindingFault + * and BindingMessageReference. + * + * @author jkaputin@apache.org + */ +public interface SOAPHeaderBlock +{ + public ElementDeclaration getElementDeclaration(); + + public Boolean mustUnderstand(); + + public Boolean isRequired(); + + public WSDLComponent getParent(); + + public SOAPHeaderBlockElement toElement(); +} Added: webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlockElement.java URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlockElement.java?rev=809835&view=auto ============================================================================== --- webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlockElement.java (added) +++ webservices/woden/trunk/java/woden-api/src/main/java/org/apache/woden/wsdl20/extensions/soap/SOAPHeaderBlockElement.java Tue Sep 1 05:54:15 2009 @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.woden.wsdl20.extensions.soap; + +import javax.xml.namespace.QName; + +import org.apache.woden.wsdl20.extensions.AttributeExtensible; +import org.apache.woden.wsdl20.extensions.ElementExtensible; +import org.apache.woden.wsdl20.extensions.ExtensionElement; +import org.apache.woden.wsdl20.xml.DocumentationElement; +import org.apache.woden.wsdl20.xml.WSDLElement; +import org.apache.ws.commons.schema.XmlSchemaElement; + +/** + * This interface represents the <wsoap:header> extension element that + * can appear within a Binding Fault or Binding Message Reference. + * + * @author jkaputin@apache.org + */ +public interface SOAPHeaderBlockElement extends ExtensionElement, + AttributeExtensible, + ElementExtensible +{ + /** + * Set the QName that identifies the Schema element declaration + * relating to this soap header. + * + * @param qname the QName that identifies a Schema element declaration + */ + public void setElementName(QName qname); + public QName getElementName(); + + /** + * Returns the Schema element declaration identified by the QName in the 'element' + * attribute of the <wsoap:header> element. + * If this QName does not resolve to an element declaration in a schema that is visible + * to the containing WSDL description, null will be returned by this method. + * To be visible, the Schema must have been correctly imported or inlined within + * the <types> element. + * + * @return the XmlSchemaElement identified by the 'element' attribute + */ + public XmlSchemaElement getElement(); + + public void setMustUnderstand(Boolean understood); + + public Boolean mustUnderstand(); + + public void setParentElement(WSDLElement wsdlEl); + + public WSDLElement getParentElement(); + + public void addDocumentationElement(DocumentationElement docEl); + + public DocumentationElement[] getDocumentationElements(); +} --------------------------------------------------------------------- To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org For additional commands, e-mail: woden-dev-help@ws.apache.org