You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2007/08/23 13:01:35 UTC

svn commit: r568932 [20/36] - in /incubator/woden/trunk/java/src/org/apache/woden: ./ ant/ internal/ internal/resolver/ internal/schema/ internal/util/ internal/util/dom/ internal/util/om/ internal/wsdl20/ internal/wsdl20/extensions/ internal/wsdl20/ex...

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java Thu Aug 23 04:01:23 2007
@@ -1,62 +1,62 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.http;
-
-import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
-import org.apache.woden.wsdl20.extensions.ExtensionElement;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
-import org.apache.woden.wsdl20.extensions.http.HTTPHeader;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-import org.apache.woden.xml.StringAttr;
-
-/**
- * This class defines the properties from the HTTP namespace
- * added to the WSDL <code>BindingMessageReference</code> component as part 
- * of the HTTP binding extension defined by the WSDL 2.0 spec. 
- * 
- * @author John Kaputin (jkaputin@apache.org)
- */
-public class HTTPBindingMessageReferenceExtensionsImpl extends ComponentExtensionsImpl 
-                                          implements HTTPBindingMessageReferenceExtensions 
-{
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions#getHttpContentEncoding()
-     * 
-     */
-    public String getHttpContentEncoding() 
-    {
-        StringAttr contentEncoding = (StringAttr) ((WSDLElement)fParent)
-            .getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING);
-        
-        return (contentEncoding != null ? contentEncoding.getString() : null);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions#getHttpHeaders()
-     */
-    public HTTPHeader[] getHttpHeaders() 
-    {
-        ExtensionElement[] extEls =  ((WSDLElement)fParent)
-            .getExtensionElementsOfType(HTTPConstants.Q_ELEM_HTTP_HEADER);
-        int len = extEls.length;
-        HTTPHeader[] httpHeaders = new HTTPHeader[len];
-        System.arraycopy(extEls, 0, httpHeaders, 0, len);
-        return httpHeaders;
-    }
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.http;
+
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPHeader;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.StringAttr;
+
+/**
+ * This class defines the properties from the HTTP namespace
+ * added to the WSDL <code>BindingMessageReference</code> component as part 
+ * of the HTTP binding extension defined by the WSDL 2.0 spec. 
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ */
+public class HTTPBindingMessageReferenceExtensionsImpl extends ComponentExtensionsImpl 
+                                          implements HTTPBindingMessageReferenceExtensions 
+{
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions#getHttpContentEncoding()
+     * 
+     */
+    public String getHttpContentEncoding() 
+    {
+        StringAttr contentEncoding = (StringAttr) ((WSDLElement)fParent)
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING);
+        
+        return (contentEncoding != null ? contentEncoding.getString() : null);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions#getHttpHeaders()
+     */
+    public HTTPHeader[] getHttpHeaders() 
+    {
+        ExtensionElement[] extEls =  ((WSDLElement)fParent)
+            .getExtensionElementsOfType(HTTPConstants.Q_ELEM_HTTP_HEADER);
+        int len = extEls.length;
+        HTTPHeader[] httpHeaders = new HTTPHeader[len];
+        System.arraycopy(extEls, 0, httpHeaders, 0, len);
+        return httpHeaders;
+    }
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java Thu Aug 23 04:01:23 2007
@@ -1,263 +1,263 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.http;
-
-import java.net.URI;
-
-import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
-import org.apache.woden.internal.wsdl20.extensions.ExtensionConstants;
-import org.apache.woden.wsdl20.Binding;
-import org.apache.woden.wsdl20.BindingOperation;
-import org.apache.woden.wsdl20.InterfaceOperation;
-import org.apache.woden.wsdl20.extensions.InterfaceOperationExtensions;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions;
-import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
-import org.apache.woden.wsdl20.extensions.http.HTTPLocation;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-import org.apache.woden.xml.BooleanAttr;
-import org.apache.woden.xml.StringAttr;
-
-/**
- * This class defines the properties from the HTTP namespace added to the WSDL
- * <code>BindingOperation</code> component as part of the HTTP binding
- * extension defined by the WSDL 2.0 spec.
- * 
- * @author John Kaputin (jkaputin@apache.org)
- * @author Arthur Ryman (ryman@ca.ibm.com, arthur.ryman@gmail.com) - added
- *         support for {http location ignore uncited}
- */
-public class HTTPBindingOperationExtensionsImpl extends ComponentExtensionsImpl
-		implements HTTPBindingOperationExtensions {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpLocation()
-	 */
-	public HTTPLocation getHttpLocation() {
-		StringAttr httpLoc = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
-		return httpLoc != null ? new HTTPLocation(httpLoc.getString()) : null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#isHttpLocationIgnoreUncited()
-	 * 
-	 * The actual value of the whttp:ignoreUncited attribute information item,
-	 * if present. Otherwise, "false".
-	 */
-	public Boolean isHttpLocationIgnoreUncited() {
-
-		BooleanAttr ignoreUncited = (BooleanAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_IGNORE_UNCITED);
-		
-		return ignoreUncited != null ? ignoreUncited.getBoolean()
-				: new Boolean(false);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpMethod()
-	 * 
-	 * 1. Return whttp:method if present on the binding operation. 
-     * 2. Otherwise return null
-     * 
-     * TODO implement steps 2,3,4 below if Part 2 spec is modified
-     * to reflect ws-desc posting 30May06 about moving this default 
-     * behaviour from binding rules into the component model. 
-     * 2. Otherwise, return whttp:methodDefault if present on the binding.
-     * 3. Otherwise, return "GET" if the {safety} extension property of 
-     *    InterfaceOperation is 'true'. 
-     * 4. Otherwise, return "POST"
-	 */
-	public String getHttpMethod() {
-
-		// 1. try whttp:method
-		StringAttr methodAttr = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_METHOD);
-		if (methodAttr != null) {
-			return methodAttr.getString();
-		}
-
-        // 2. return null (i.e. no default specified in the spec...yet) 
-        return null; //TODO remove if default behaviour below is used.
-        
-
-        /* TODO Uncomment the following code if the defaults descibed for 
-         * binding rules in Part 2, 6.3.1 HTTP Method Selection, are moved
-         * into the Component model (i.e. the defaults are applied in the 
-         * component model, not left to the binder to enforce them.
-         * See posting ws-desc 30May06.
-         *
-         * // 2. try whttp:methodDefault
-         * Binding binding = (Binding) ((BindingOperation) fParent).getParent();
-         * 
-         * HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions) binding
-         *         .getComponentExtensionsForNamespace(HTTPConstants.NS_URI_HTTP);
-         * 
-         * // no need to check for a null httpBindExts because Binding has REQUIRED
-         * // http extension properties
-         * String methodDef = httpBindExts.getHttpMethodDefault();
-         * if (methodDef != null) {
-         *     return methodDef;
-         * }
-         *        
-		 * // 3. try {safety}
-		 * InterfaceOperation intOper = ((BindingOperation) fParent)
-		 *         .getInterfaceOperation();
-		 * if (intOper != null) {
-		 *    InterfaceOperationExtensions intOperExts = (InterfaceOperationExtensions) intOper
-		 *            .getComponentExtensionsForNamespace(URI
-		 *                    .create(ExtensionConstants.NS_URI_WSDL_EXTENSIONS));
-		 *    if (intOperExts != null && intOperExts.isSafety()) {
-		 *       return HTTPConstants.METHOD_GET;
-		 *    }
-		 * }
-         *
-		 * // 4. default to POST.
-		 * return HTTPConstants.METHOD_POST;
-         */
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpInputSerialization()
-     * 
-     * Per Part 2, sect 6.3.3, if this attribute is omitted then 
-     * {http input serialization} will be application/x-www-form-urlencoded if
-     * {http method} is GET or DELETE, or application/xml if {http method} has
-     * any other value.
-	 */
-	public String getHttpInputSerialization() {
-        
-		StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_INPUT_SERIALIZATION);
-		if (serialization != null) {
-			return serialization.getString();
-		}
-
-        //TODO replace determineHttpMethod() with getHttpMethod() if spec is
-        //modified to define {http method} defaults in the component model
-		String method = determineHttpMethod();
-        
-		if (method.equals(HTTPConstants.METHOD_GET)
-				|| method.equals(HTTPConstants.METHOD_DELETE)) {
-			return HTTPConstants.SERIAL_APP_URLENCODED;
-		} else {
-			// for POST, PUT or any other method type (Part 2 sect 6.3.3)
-			return HTTPConstants.SERIAL_APP_XML;
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpOutputSerialization()
-     * 
-     * Per Part 2, sect 6.3.3, if this attribute is omitted then 
-     * {http output serialization} will be application/xml for any {http method}
-     * value.
-	 */
-	public String getHttpOutputSerialization() {
-		StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_OUTPUT_SERIALIZATION);
-		return serialization != null ? serialization.getString()
-				: HTTPConstants.SERIAL_APP_XML;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpFaultSerialization()
-     * 
-     * Per Part 2, sect 6.4.5, if attribute omitted default to application/xml.
-	 */
-	public String getHttpFaultSerialization() {
-		StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_FAULT_SERIALIZATION);
-		return serialization != null ? serialization.getString()
-				: HTTPConstants.SERIAL_APP_XML;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpQueryParameterSeparator()
-	 */
-	public String getHttpQueryParameterSeparator() {
-        
-		StringAttr separator = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR);
-        return separator != null ? separator.getString() : null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpContentEncodingDefault()
-	 */
-	public String getHttpContentEncodingDefault() {
-		StringAttr contEncodingDef = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT);
-		return contEncodingDef != null ? contEncodingDef.getString() : null;
-	}
-    
-    /*
-     * This default behaviour for http method is referred to in the spec
-     * Part 2 when determining default values for input and output 
-     * serialization in the component model extensions (i.e. 6.3.3 refers
-     * to 6.3.1). If spec is changed to define this default behaviour directly
-     * for the {http method} property, this behaviour will move to the 
-     * getHttpMethod() method and this private method can be removed.
-     */
-    private String determineHttpMethod() {
-        
-        // 1. try whttp:method
-        String method = getHttpMethod();
-        if(method != null) return method;
-        
-        // 2. try whttp:methodDefault
-        Binding binding = (Binding) ((BindingOperation) fParent).getParent();
-        
-        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions) binding
-                .getComponentExtensionsForNamespace(HTTPConstants.NS_URI_HTTP);
-        
-        // no need to check for a null httpBindExts because Binding has REQUIRED
-        // http extension properties
-        String methodDef = httpBindExts.getHttpMethodDefault();
-        if (methodDef != null) return methodDef;
-               
-        // 3. try {safety} equals True
-        InterfaceOperation intOper = ((BindingOperation) fParent)
-                .getInterfaceOperation();
-        if (intOper != null) {
-            InterfaceOperationExtensions intOperExts = (InterfaceOperationExtensions) intOper
-                    .getComponentExtensionsForNamespace(URI
-                           .create(ExtensionConstants.NS_URI_WSDL_EXTENSIONS));
-           if (intOperExts != null && intOperExts.isSafety()) {
-              return HTTPConstants.METHOD_GET;
-           }
-        }
-        
-        // 4. default to POST.
-        return HTTPConstants.METHOD_POST;
-    }
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.http;
+
+import java.net.URI;
+
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.ExtensionConstants;
+import org.apache.woden.wsdl20.Binding;
+import org.apache.woden.wsdl20.BindingOperation;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.extensions.InterfaceOperationExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPLocation;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.BooleanAttr;
+import org.apache.woden.xml.StringAttr;
+
+/**
+ * This class defines the properties from the HTTP namespace added to the WSDL
+ * <code>BindingOperation</code> component as part of the HTTP binding
+ * extension defined by the WSDL 2.0 spec.
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ * @author Arthur Ryman (ryman@ca.ibm.com, arthur.ryman@gmail.com) - added
+ *         support for {http location ignore uncited}
+ */
+public class HTTPBindingOperationExtensionsImpl extends ComponentExtensionsImpl
+		implements HTTPBindingOperationExtensions {
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpLocation()
+	 */
+	public HTTPLocation getHttpLocation() {
+		StringAttr httpLoc = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
+		return httpLoc != null ? new HTTPLocation(httpLoc.getString()) : null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#isHttpLocationIgnoreUncited()
+	 * 
+	 * The actual value of the whttp:ignoreUncited attribute information item,
+	 * if present. Otherwise, "false".
+	 */
+	public Boolean isHttpLocationIgnoreUncited() {
+
+		BooleanAttr ignoreUncited = (BooleanAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_IGNORE_UNCITED);
+		
+		return ignoreUncited != null ? ignoreUncited.getBoolean()
+				: new Boolean(false);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpMethod()
+	 * 
+	 * 1. Return whttp:method if present on the binding operation. 
+     * 2. Otherwise return null
+     * 
+     * TODO implement steps 2,3,4 below if Part 2 spec is modified
+     * to reflect ws-desc posting 30May06 about moving this default 
+     * behaviour from binding rules into the component model. 
+     * 2. Otherwise, return whttp:methodDefault if present on the binding.
+     * 3. Otherwise, return "GET" if the {safety} extension property of 
+     *    InterfaceOperation is 'true'. 
+     * 4. Otherwise, return "POST"
+	 */
+	public String getHttpMethod() {
+
+		// 1. try whttp:method
+		StringAttr methodAttr = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_METHOD);
+		if (methodAttr != null) {
+			return methodAttr.getString();
+		}
+
+        // 2. return null (i.e. no default specified in the spec...yet) 
+        return null; //TODO remove if default behaviour below is used.
+        
+
+        /* TODO Uncomment the following code if the defaults descibed for 
+         * binding rules in Part 2, 6.3.1 HTTP Method Selection, are moved
+         * into the Component model (i.e. the defaults are applied in the 
+         * component model, not left to the binder to enforce them.
+         * See posting ws-desc 30May06.
+         *
+         * // 2. try whttp:methodDefault
+         * Binding binding = (Binding) ((BindingOperation) fParent).getParent();
+         * 
+         * HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions) binding
+         *         .getComponentExtensionsForNamespace(HTTPConstants.NS_URI_HTTP);
+         * 
+         * // no need to check for a null httpBindExts because Binding has REQUIRED
+         * // http extension properties
+         * String methodDef = httpBindExts.getHttpMethodDefault();
+         * if (methodDef != null) {
+         *     return methodDef;
+         * }
+         *        
+		 * // 3. try {safety}
+		 * InterfaceOperation intOper = ((BindingOperation) fParent)
+		 *         .getInterfaceOperation();
+		 * if (intOper != null) {
+		 *    InterfaceOperationExtensions intOperExts = (InterfaceOperationExtensions) intOper
+		 *            .getComponentExtensionsForNamespace(URI
+		 *                    .create(ExtensionConstants.NS_URI_WSDL_EXTENSIONS));
+		 *    if (intOperExts != null && intOperExts.isSafety()) {
+		 *       return HTTPConstants.METHOD_GET;
+		 *    }
+		 * }
+         *
+		 * // 4. default to POST.
+		 * return HTTPConstants.METHOD_POST;
+         */
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpInputSerialization()
+     * 
+     * Per Part 2, sect 6.3.3, if this attribute is omitted then 
+     * {http input serialization} will be application/x-www-form-urlencoded if
+     * {http method} is GET or DELETE, or application/xml if {http method} has
+     * any other value.
+	 */
+	public String getHttpInputSerialization() {
+        
+		StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_INPUT_SERIALIZATION);
+		if (serialization != null) {
+			return serialization.getString();
+		}
+
+        //TODO replace determineHttpMethod() with getHttpMethod() if spec is
+        //modified to define {http method} defaults in the component model
+		String method = determineHttpMethod();
+        
+		if (method.equals(HTTPConstants.METHOD_GET)
+				|| method.equals(HTTPConstants.METHOD_DELETE)) {
+			return HTTPConstants.SERIAL_APP_URLENCODED;
+		} else {
+			// for POST, PUT or any other method type (Part 2 sect 6.3.3)
+			return HTTPConstants.SERIAL_APP_XML;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpOutputSerialization()
+     * 
+     * Per Part 2, sect 6.3.3, if this attribute is omitted then 
+     * {http output serialization} will be application/xml for any {http method}
+     * value.
+	 */
+	public String getHttpOutputSerialization() {
+		StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_OUTPUT_SERIALIZATION);
+		return serialization != null ? serialization.getString()
+				: HTTPConstants.SERIAL_APP_XML;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpFaultSerialization()
+     * 
+     * Per Part 2, sect 6.4.5, if attribute omitted default to application/xml.
+	 */
+	public String getHttpFaultSerialization() {
+		StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_FAULT_SERIALIZATION);
+		return serialization != null ? serialization.getString()
+				: HTTPConstants.SERIAL_APP_XML;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpQueryParameterSeparator()
+	 */
+	public String getHttpQueryParameterSeparator() {
+        
+		StringAttr separator = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR);
+        return separator != null ? separator.getString() : null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpContentEncodingDefault()
+	 */
+	public String getHttpContentEncodingDefault() {
+		StringAttr contEncodingDef = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT);
+		return contEncodingDef != null ? contEncodingDef.getString() : null;
+	}
+    
+    /*
+     * This default behaviour for http method is referred to in the spec
+     * Part 2 when determining default values for input and output 
+     * serialization in the component model extensions (i.e. 6.3.3 refers
+     * to 6.3.1). If spec is changed to define this default behaviour directly
+     * for the {http method} property, this behaviour will move to the 
+     * getHttpMethod() method and this private method can be removed.
+     */
+    private String determineHttpMethod() {
+        
+        // 1. try whttp:method
+        String method = getHttpMethod();
+        if(method != null) return method;
+        
+        // 2. try whttp:methodDefault
+        Binding binding = (Binding) ((BindingOperation) fParent).getParent();
+        
+        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions) binding
+                .getComponentExtensionsForNamespace(HTTPConstants.NS_URI_HTTP);
+        
+        // no need to check for a null httpBindExts because Binding has REQUIRED
+        // http extension properties
+        String methodDef = httpBindExts.getHttpMethodDefault();
+        if (methodDef != null) return methodDef;
+               
+        // 3. try {safety} equals True
+        InterfaceOperation intOper = ((BindingOperation) fParent)
+                .getInterfaceOperation();
+        if (intOper != null) {
+            InterfaceOperationExtensions intOperExts = (InterfaceOperationExtensions) intOper
+                    .getComponentExtensionsForNamespace(URI
+                           .create(ExtensionConstants.NS_URI_WSDL_EXTENSIONS));
+           if (intOperExts != null && intOperExts.isSafety()) {
+              return HTTPConstants.METHOD_GET;
+           }
+        }
+        
+        // 4. default to POST.
+        return HTTPConstants.METHOD_POST;
+    }
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java Thu Aug 23 04:01:23 2007
@@ -1,124 +1,124 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.http;
-
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-/**
- * @author John Kaputin (jkaputin@apache.org)
- */
-public class HTTPConstants 
-{
-    // Namespace URIs.
-    public static final String NS_STRING_HTTP =
-        "http://www.w3.org/ns/wsdl/http";
-    
-    public static final URI NS_URI_HTTP = URI.create(NS_STRING_HTTP);
-    
-    // Element names.
-    public static final String ELEM_HEADER = "header";
-
-    // Attribute names.
-    public static final String ATTR_AUTHENTICATION_REALM = "authenticationRealm";
-    public static final String ATTR_AUTHENTICATION_SCHEME = "authenticationScheme";
-    public static final String ATTR_CODE = "code";
-    public static final String ATTR_COOKIES = "cookies";
-    public static final String ATTR_FAULT_SERIALIZATION = "faultSerialization";
-    public static final String ATTR_IGNORE_UNCITED = "ignoreUncited";
-    public static final String ATTR_INPUT_SERIALIZATION = "inputSerialization";
-    public static final String ATTR_LOCATION = "location";
-    public static final String ATTR_METHOD = "method";
-    public static final String ATTR_METHOD_DEFAULT = "methodDefault";
-    public static final String ATTR_OUTPUT_SERIALIZATION = "outputSerialization";
-    public static final String ATTR_QUERY_PARAMETER_SEPARATOR = "queryParameterSeparator";
-    public static final String ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT = "queryParameterSeparatorDefault";
-    public static final String ATTR_CONTENT_ENCODING = "contentEncoding";
-    public static final String ATTR_CONTENT_ENCODING_DEFAULT = "contentEncodingDefault";
-    
-    // Prefixes
-    public static final String PFX_WHTTP = "whttp";
-
-    // Qualified element names.
-    
-    public static final QName Q_ELEM_HTTP_HEADER =
-        new QName(NS_STRING_HTTP, ELEM_HEADER, PFX_WHTTP);
-
-    // Qualified attribute names.
-    
-    public static final QName Q_ATTR_AUTHENTICATION_REALM =
-        new QName(NS_STRING_HTTP, ATTR_AUTHENTICATION_REALM, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_AUTHENTICATION_SCHEME =
-        new QName(NS_STRING_HTTP, ATTR_AUTHENTICATION_SCHEME, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_CODE =
-        new QName(NS_STRING_HTTP, ATTR_CODE, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_COOKIES =
-        new QName(NS_STRING_HTTP, ATTR_COOKIES, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_FAULT_SERIALIZATION =
-        new QName(NS_STRING_HTTP, ATTR_FAULT_SERIALIZATION, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_IGNORE_UNCITED =
-        new QName(NS_STRING_HTTP, ATTR_IGNORE_UNCITED, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_INPUT_SERIALIZATION =
-        new QName(NS_STRING_HTTP, ATTR_INPUT_SERIALIZATION, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_LOCATION =
-        new QName(NS_STRING_HTTP, ATTR_LOCATION, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_METHOD =
-        new QName(NS_STRING_HTTP, ATTR_METHOD, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_METHOD_DEFAULT =
-        new QName(NS_STRING_HTTP, ATTR_METHOD_DEFAULT, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_OUTPUT_SERIALIZATION =
-        new QName(NS_STRING_HTTP, ATTR_OUTPUT_SERIALIZATION, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_QUERY_PARAMETER_SEPARATOR =
-        new QName(NS_STRING_HTTP, ATTR_QUERY_PARAMETER_SEPARATOR, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT =
-        new QName(NS_STRING_HTTP, ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_CONTENT_ENCODING =
-        new QName(NS_STRING_HTTP, ATTR_CONTENT_ENCODING, PFX_WHTTP);
-      
-    public static final QName Q_ATTR_CONTENT_ENCODING_DEFAULT =
-        new QName(NS_STRING_HTTP, ATTR_CONTENT_ENCODING_DEFAULT, PFX_WHTTP);
-    
-    //{http method} constants
-    
-    public static final String METHOD_GET = "GET";
-    public static final String METHOD_POST = "POST";
-    public static final String METHOD_PUT = "PUT";
-    public static final String METHOD_DELETE = "DELETE";
-    
-    
-    //{input/output serialization} constants
-    
-    public static final String SERIAL_APP_URLENCODED = "application/x-www-form-urlencoded";
-    public static final String SERIAL_APP_XML = "application/xml";
-
-    public static final String QUERY_SEP_AMPERSAND = "&";
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.http;
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author John Kaputin (jkaputin@apache.org)
+ */
+public class HTTPConstants 
+{
+    // Namespace URIs.
+    public static final String NS_STRING_HTTP =
+        "http://www.w3.org/ns/wsdl/http";
+    
+    public static final URI NS_URI_HTTP = URI.create(NS_STRING_HTTP);
+    
+    // Element names.
+    public static final String ELEM_HEADER = "header";
+
+    // Attribute names.
+    public static final String ATTR_AUTHENTICATION_REALM = "authenticationRealm";
+    public static final String ATTR_AUTHENTICATION_SCHEME = "authenticationScheme";
+    public static final String ATTR_CODE = "code";
+    public static final String ATTR_COOKIES = "cookies";
+    public static final String ATTR_FAULT_SERIALIZATION = "faultSerialization";
+    public static final String ATTR_IGNORE_UNCITED = "ignoreUncited";
+    public static final String ATTR_INPUT_SERIALIZATION = "inputSerialization";
+    public static final String ATTR_LOCATION = "location";
+    public static final String ATTR_METHOD = "method";
+    public static final String ATTR_METHOD_DEFAULT = "methodDefault";
+    public static final String ATTR_OUTPUT_SERIALIZATION = "outputSerialization";
+    public static final String ATTR_QUERY_PARAMETER_SEPARATOR = "queryParameterSeparator";
+    public static final String ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT = "queryParameterSeparatorDefault";
+    public static final String ATTR_CONTENT_ENCODING = "contentEncoding";
+    public static final String ATTR_CONTENT_ENCODING_DEFAULT = "contentEncodingDefault";
+    
+    // Prefixes
+    public static final String PFX_WHTTP = "whttp";
+
+    // Qualified element names.
+    
+    public static final QName Q_ELEM_HTTP_HEADER =
+        new QName(NS_STRING_HTTP, ELEM_HEADER, PFX_WHTTP);
+
+    // Qualified attribute names.
+    
+    public static final QName Q_ATTR_AUTHENTICATION_REALM =
+        new QName(NS_STRING_HTTP, ATTR_AUTHENTICATION_REALM, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_AUTHENTICATION_SCHEME =
+        new QName(NS_STRING_HTTP, ATTR_AUTHENTICATION_SCHEME, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_CODE =
+        new QName(NS_STRING_HTTP, ATTR_CODE, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_COOKIES =
+        new QName(NS_STRING_HTTP, ATTR_COOKIES, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_FAULT_SERIALIZATION =
+        new QName(NS_STRING_HTTP, ATTR_FAULT_SERIALIZATION, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_IGNORE_UNCITED =
+        new QName(NS_STRING_HTTP, ATTR_IGNORE_UNCITED, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_INPUT_SERIALIZATION =
+        new QName(NS_STRING_HTTP, ATTR_INPUT_SERIALIZATION, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_LOCATION =
+        new QName(NS_STRING_HTTP, ATTR_LOCATION, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_METHOD =
+        new QName(NS_STRING_HTTP, ATTR_METHOD, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_METHOD_DEFAULT =
+        new QName(NS_STRING_HTTP, ATTR_METHOD_DEFAULT, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_OUTPUT_SERIALIZATION =
+        new QName(NS_STRING_HTTP, ATTR_OUTPUT_SERIALIZATION, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_QUERY_PARAMETER_SEPARATOR =
+        new QName(NS_STRING_HTTP, ATTR_QUERY_PARAMETER_SEPARATOR, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT =
+        new QName(NS_STRING_HTTP, ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_CONTENT_ENCODING =
+        new QName(NS_STRING_HTTP, ATTR_CONTENT_ENCODING, PFX_WHTTP);
+      
+    public static final QName Q_ATTR_CONTENT_ENCODING_DEFAULT =
+        new QName(NS_STRING_HTTP, ATTR_CONTENT_ENCODING_DEFAULT, PFX_WHTTP);
+    
+    //{http method} constants
+    
+    public static final String METHOD_GET = "GET";
+    public static final String METHOD_POST = "POST";
+    public static final String METHOD_PUT = "PUT";
+    public static final String METHOD_DELETE = "DELETE";
+    
+    
+    //{input/output serialization} constants
+    
+    public static final String SERIAL_APP_URLENCODED = "application/x-www-form-urlencoded";
+    public static final String SERIAL_APP_XML = "application/xml";
+
+    public static final String QUERY_SEP_AMPERSAND = "&";
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java Thu Aug 23 04:01:23 2007
@@ -1,63 +1,63 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.http;
-
-import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
-import org.apache.woden.wsdl20.extensions.http.HTTPAuthenticationScheme;
-import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-import org.apache.woden.xml.HTTPAuthenticationSchemeAttr;
-import org.apache.woden.xml.StringAttr;
-
-/**
- * This class defines the properties from the HTTP namespace added to the WSDL
- * <code>Endpoint</code> component as part of the HTTP binding extension
- * defined by the WSDL 2.0 spec.
- * 
- * @author Arthur Ryman (ryman@ca.ibm.com, arthur.ryman@gmail.com)
- * 
- */
-public class HTTPEndpointExtensionsImpl extends ComponentExtensionsImpl
-		implements HTTPEndpointExtensions {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions#getHttpAuthenticationScheme()
-	 */
-	public HTTPAuthenticationScheme getHttpAuthenticationScheme() {
-
-		HTTPAuthenticationSchemeAttr scheme = (HTTPAuthenticationSchemeAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_SCHEME);
-
-		return scheme != null ? scheme.getScheme() : null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions#getHttpAuthenticationRealm()
-	 */
-	public String getHttpAuthenticationRealm() {
-
-		StringAttr realm = (StringAttr) ((WSDLElement) fParent)
-				.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_REALM);
-
-		return realm != null ? realm.getString() : null;
-	}
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.http;
+
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.wsdl20.extensions.http.HTTPAuthenticationScheme;
+import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.HTTPAuthenticationSchemeAttr;
+import org.apache.woden.xml.StringAttr;
+
+/**
+ * This class defines the properties from the HTTP namespace added to the WSDL
+ * <code>Endpoint</code> component as part of the HTTP binding extension
+ * defined by the WSDL 2.0 spec.
+ * 
+ * @author Arthur Ryman (ryman@ca.ibm.com, arthur.ryman@gmail.com)
+ * 
+ */
+public class HTTPEndpointExtensionsImpl extends ComponentExtensionsImpl
+		implements HTTPEndpointExtensions {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions#getHttpAuthenticationScheme()
+	 */
+	public HTTPAuthenticationScheme getHttpAuthenticationScheme() {
+
+		HTTPAuthenticationSchemeAttr scheme = (HTTPAuthenticationSchemeAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_SCHEME);
+
+		return scheme != null ? scheme.getScheme() : null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions#getHttpAuthenticationRealm()
+	 */
+	public String getHttpAuthenticationRealm() {
+
+		StringAttr realm = (StringAttr) ((WSDLElement) fParent)
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_REALM);
+
+		return realm != null ? realm.getString() : null;
+	}
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java Thu Aug 23 04:01:23 2007
@@ -1,98 +1,98 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.http;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.ErrorReporter;
-import org.apache.woden.WSDLException;
-import org.apache.woden.XMLElement;
-import org.apache.woden.internal.ErrorLocatorImpl;
-import org.apache.woden.internal.wsdl20.Constants;
-import org.apache.woden.wsdl20.extensions.ExtensionDeserializer;
-import org.apache.woden.wsdl20.extensions.ExtensionElement;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
-import org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
-import org.apache.woden.wsdl20.xml.DocumentableElement;
-import org.apache.woden.wsdl20.xml.DocumentationElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-
-/**
- * Deserializes the &lt;whttp:header&gt; extension element into a HTTPHeaderElement.
- * 
- * @author John Kaputin (jkaputin@apache.org)
- *
- */
-public class HTTPHeaderDeserializer implements ExtensionDeserializer {
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ExtensionDeserializer#unmarshall(java.lang.Class, java.lang.Object, javax.xml.namespace.QName, org.w3c.dom.Element, org.apache.woden.wsdl20.xml.DescriptionElement, org.apache.woden.wsdl20.extensions.ExtensionRegistry)
-     */
-    public ExtensionElement unmarshall(Class parentType, 
-                                       Object parent,
-                                       QName extType, 
-                                       XMLElement extEl,
-                                       DescriptionElement desc,
-                                       ExtensionRegistry extReg) 
-                                       throws WSDLException 
-    {
-        HTTPHeaderElement httpHdr = 
-            (HTTPHeaderElement) extReg.createExtElement(parentType, extType);
-        
-        httpHdr.setExtensionType(extType);
-        httpHdr.setParentElement((WSDLElement)parent);
-        
-        String name = extEl.getAttributeValue(Constants.ATTR_NAME);
-        httpHdr.setName(name);
-        
-        String typeQN = extEl.getAttributeValue(Constants.ATTR_TYPE);
-        if(typeQN != null)
-        {
-            try {
-                QName qname = extEl.getQName(typeQN);
-                httpHdr.setTypeName(qname);
-            } catch (WSDLException e) {
-                extReg.getErrorReporter().reportError( 
-                        new ErrorLocatorImpl(),  //TODO line&col nos.
-                        "WSDL505",
-                        new Object[] {typeQN, extEl.getLocalName()}, 
-                        ErrorReporter.SEVERITY_ERROR);
-            }
-        }
-
-        //TRUE if attribute is "true", FALSE if it is "false", omitted or non-boolean.
-        String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
-        httpHdr.setRequired(new Boolean(required));
-
-        return httpHdr;
-    }
-
-    private DocumentationElement parseDocumentation(XMLElement docEl, 
-                                                    DocumentableElement parent) 
-                                                    throws WSDLException
-    {
-        DocumentationElement documentation = parent.addDocumentationElement();
-        documentation.setContent(docEl);
-        
-        //TODO parseExtensionAttributes(docEl, DocumentationElement.class, documentation, desc);
-        //TODO parseExtensionElements(...)
-        
-        return documentation;
-    }
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.http;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.ErrorReporter;
+import org.apache.woden.WSDLException;
+import org.apache.woden.XMLElement;
+import org.apache.woden.internal.ErrorLocatorImpl;
+import org.apache.woden.internal.wsdl20.Constants;
+import org.apache.woden.wsdl20.extensions.ExtensionDeserializer;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
+import org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.DocumentableElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+
+/**
+ * Deserializes the &lt;whttp:header&gt; extension element into a HTTPHeaderElement.
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ *
+ */
+public class HTTPHeaderDeserializer implements ExtensionDeserializer {
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionDeserializer#unmarshall(java.lang.Class, java.lang.Object, javax.xml.namespace.QName, org.w3c.dom.Element, org.apache.woden.wsdl20.xml.DescriptionElement, org.apache.woden.wsdl20.extensions.ExtensionRegistry)
+     */
+    public ExtensionElement unmarshall(Class parentType, 
+                                       Object parent,
+                                       QName extType, 
+                                       XMLElement extEl,
+                                       DescriptionElement desc,
+                                       ExtensionRegistry extReg) 
+                                       throws WSDLException 
+    {
+        HTTPHeaderElement httpHdr = 
+            (HTTPHeaderElement) extReg.createExtElement(parentType, extType);
+        
+        httpHdr.setExtensionType(extType);
+        httpHdr.setParentElement((WSDLElement)parent);
+        
+        String name = extEl.getAttributeValue(Constants.ATTR_NAME);
+        httpHdr.setName(name);
+        
+        String typeQN = extEl.getAttributeValue(Constants.ATTR_TYPE);
+        if(typeQN != null)
+        {
+            try {
+                QName qname = extEl.getQName(typeQN);
+                httpHdr.setTypeName(qname);
+            } catch (WSDLException e) {
+                extReg.getErrorReporter().reportError( 
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL505",
+                        new Object[] {typeQN, extEl.getLocalName()}, 
+                        ErrorReporter.SEVERITY_ERROR);
+            }
+        }
+
+        //TRUE if attribute is "true", FALSE if it is "false", omitted or non-boolean.
+        String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
+        httpHdr.setRequired(new Boolean(required));
+
+        return httpHdr;
+    }
+
+    private DocumentationElement parseDocumentation(XMLElement docEl, 
+                                                    DocumentableElement parent) 
+                                                    throws WSDLException
+    {
+        DocumentationElement documentation = parent.addDocumentationElement();
+        documentation.setContent(docEl);
+        
+        //TODO parseExtensionAttributes(docEl, DocumentationElement.class, documentation, desc);
+        //TODO parseExtensionElements(...)
+        
+        return documentation;
+    }
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java Thu Aug 23 04:01:23 2007
@@ -1,310 +1,310 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.http;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.woden.internal.wsdl20.BindingImpl;
-import org.apache.woden.internal.wsdl20.TypesImpl;
-import org.apache.woden.internal.wsdl20.extensions.AttributeExtensibleImpl;
-import org.apache.woden.internal.wsdl20.extensions.ElementExtensibleImpl;
-import org.apache.woden.internal.wsdl20.extensions.ExtensionElementImpl;
-import org.apache.woden.wsdl20.Description;
-import org.apache.woden.wsdl20.NestedComponent;
-import org.apache.woden.wsdl20.TypeDefinition;
-import org.apache.woden.wsdl20.WSDLComponent;
-import org.apache.woden.wsdl20.extensions.ExtensionElement;
-import org.apache.woden.wsdl20.extensions.http.HTTPHeader;
-import org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
-import org.apache.woden.wsdl20.xml.DocumentationElement;
-import org.apache.woden.wsdl20.xml.NestedElement;
-import org.apache.woden.wsdl20.xml.WSDLElement;
-import org.apache.woden.xml.XMLAttr;
-import org.apache.ws.commons.schema.XmlSchemaType;
-
-/**
- * This class represents the HTTPHeader Component and the &lt;whttp:header&gt; 
- * extension element that can appear within a Binding Fault or Binding Message 
- * Reference.
- * 
- * @author John Kaputin (jkaputin@apache.org)
- */
-public class HTTPHeaderImpl implements HTTPHeader, HTTPHeaderElement 
-{
-    private WSDLElement fParent = null;
-    private List fDocumentationElements = new Vector();
-    private ExtensionElement fExtElem = new ExtensionElementImpl();
-    private AttributeExtensibleImpl fAttrExt = new AttributeExtensibleImpl();
-    private ElementExtensibleImpl fElemExt = new ElementExtensibleImpl();
-    private String fName = null;
-    private QName fTypeName = null;
-
-    /* ***********************************************************************
-     *  Component model methods (HTTPHeader interface), some shared with Element model
-     * ***********************************************************************/
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#getName()
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getName()
-     */
-    public String getName() {
-        return fName;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#getTypeDefinition()
-     */
-    public TypeDefinition getTypeDefinition() 
-    {
-        TypeDefinition typeDef = null;
-        Description desc = getDescriptionComponent(getParent());
-        typeDef = desc.getTypeDefinition(fTypeName);
-        return typeDef;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#isRequired()
-     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#isRequired()
-     */
-    public Boolean isRequired() {
-        return fExtElem.isRequired();
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#getParent()
-     */
-    public WSDLComponent getParent() {
-        return (WSDLComponent)fParent;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#toElement()
-     */
-    public HTTPHeaderElement toElement() {
-        return this;
-    }
-
-    /* ***********************************************************************
-     *  Element model-only methods (HTTPHeaderElement interface)
-     * ***********************************************************************/
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#setName(java.lang.String)
-     */
-    public void setName(String name) {
-        fName = name;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#setTypeName(javax.xml.namespace.QName)
-     */
-    public void setTypeName(QName qname) {
-        fTypeName = qname;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getTypeName()
-     */
-    public QName getTypeName() {
-        return fTypeName;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getType()
-     */
-    public XmlSchemaType getType() 
-    {
-        XmlSchemaType xst = null;
-        DescriptionElement desc = getDescriptionElement(getParentElement());
-        TypesImpl types = (TypesImpl)desc.getTypesElement();
-        if(types != null) {
-            xst = types.getTypeDefinition(fTypeName);
-        }
-        return xst;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#setParentElement(org.apache.woden.wsdl20.xml.WSDLElement)
-     */
-    public void setParentElement(WSDLElement wsdlEl) {
-        fParent = wsdlEl;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getParentElement()
-     */
-    public WSDLElement getParentElement() {
-        return fParent;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#addDocumentationElement(org.apache.woden.wsdl20.xml.DocumentationElement)
-     */
-    public void addDocumentationElement(DocumentationElement docEl) {
-        if(docEl != null) {
-            fDocumentationElements.add(docEl);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getDocumentationElements()
-     */
-    public DocumentationElement[] getDocumentationElements() {
-        DocumentationElement[] array = new DocumentationElement[fDocumentationElements.size()];
-        fDocumentationElements.toArray(array);
-        return array;
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#setExtensionType(javax.xml.namespace.QName)
-     */
-    public void setExtensionType(QName qname) {
-        fExtElem.setExtensionType(qname);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#getExtensionType()
-     */
-    public QName getExtensionType() {
-        return fExtElem.getExtensionType();
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#setRequired(java.lang.Boolean)
-     */
-    public void setRequired(Boolean required) {
-        fExtElem.setRequired(required);
-    }
-
-    /* ***********************************************************************
-     *  Extensibility methods
-     * ***********************************************************************/
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#setExtensionAttribute(javax.xml.namespace.QName, org.apache.woden.xml.XMLAttr)
-     */
-    public void setExtensionAttribute(QName attrType, XMLAttr attr) {
-        fAttrExt.setExtensionAttribute(attrType, attr);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttribute(javax.xml.namespace.QName)
-     */
-    public XMLAttr getExtensionAttribute(QName attrType) {
-        return fAttrExt.getExtensionAttribute(attrType);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributesForNamespace(java.net.URI)
-     */
-    public XMLAttr[] getExtensionAttributesForNamespace(URI namespace) {
-        return fAttrExt.getExtensionAttributesForNamespace(namespace);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributes()
-     */
-    public XMLAttr[] getExtensionAttributes() {
-        return fAttrExt.getExtensionAttributes();
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#hasExtensionAttributesForNamespace(java.net.URI)
-     */
-    public boolean hasExtensionAttributesForNamespace(URI namespace) {
-        return fAttrExt.hasExtensionAttributesForNamespace(namespace);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#addExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
-     */
-    public void addExtensionElement(ExtensionElement extEl) {
-        fElemExt.addExtensionElement(extEl);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#removeExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
-     */
-    public void removeExtensionElement(ExtensionElement extEl) {
-        fElemExt.removeExtensionElement(extEl);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElements()
-     */
-    public ExtensionElement[] getExtensionElements() {
-        return fElemExt.getExtensionElements();
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElementsOfType(javax.xml.namespace.QName)
-     */
-    public ExtensionElement[] getExtensionElementsOfType(QName extType) {
-        return fElemExt.getExtensionElementsOfType(extType);
-    }
-
-    /* (non-Javadoc)
-     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#hasExtensionElementsForNamespace(java.net.URI)
-     */
-    public boolean hasExtensionElementsForNamespace(URI namespace) {
-        return fElemExt.hasExtensionElementsForNamespace(namespace);
-    }
-
-    /* ************************************************************
-     *  Non-API implementation methods
-     * ************************************************************/
-    
-    /*
-     * This method traverses up the element graph to get the root <description>.
-     * TODO consider its usefulness to user-defined extensions and whether to refactor it.
-     * e.g. declared in ExtensionElement and implemented in ExtensionElementImpl
-     */
-    private DescriptionElement getDescriptionElement(WSDLElement wsdlElem)
-    {
-        if(wsdlElem instanceof BindingImpl) 
-        {
-            return (DescriptionElement) ((NestedElement)wsdlElem).getParentElement();
-        }
-        else
-        {
-            WSDLElement parentElem = ((NestedElement)wsdlElem).getParentElement();
-            return getDescriptionElement(parentElem);
-        }
-    }
-    
-    /* 
-     * TODO ditto previous comment about possibly refactoring this for user-defined extensions to reuse. 
-     */
-    private Description getDescriptionComponent(WSDLComponent wsdlComp)
-    {
-        if(wsdlComp instanceof BindingImpl) 
-        {
-            return ((BindingImpl)wsdlComp).getDescriptionComponent();
-        }
-        else 
-        {
-            WSDLComponent parentComp = ((NestedComponent)wsdlComp).getParent();
-            return getDescriptionComponent(parentComp);
-        } 
-    }
-    
-}
+ * 
+ *     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.internal.wsdl20.extensions.http;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.internal.wsdl20.BindingImpl;
+import org.apache.woden.internal.wsdl20.TypesImpl;
+import org.apache.woden.internal.wsdl20.extensions.AttributeExtensibleImpl;
+import org.apache.woden.internal.wsdl20.extensions.ElementExtensibleImpl;
+import org.apache.woden.internal.wsdl20.extensions.ExtensionElementImpl;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.NestedComponent;
+import org.apache.woden.wsdl20.TypeDefinition;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.http.HTTPHeader;
+import org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.NestedElement;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.XMLAttr;
+import org.apache.ws.commons.schema.XmlSchemaType;
+
+/**
+ * This class represents the HTTPHeader Component and the &lt;whttp:header&gt; 
+ * extension element that can appear within a Binding Fault or Binding Message 
+ * Reference.
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ */
+public class HTTPHeaderImpl implements HTTPHeader, HTTPHeaderElement 
+{
+    private WSDLElement fParent = null;
+    private List fDocumentationElements = new Vector();
+    private ExtensionElement fExtElem = new ExtensionElementImpl();
+    private AttributeExtensibleImpl fAttrExt = new AttributeExtensibleImpl();
+    private ElementExtensibleImpl fElemExt = new ElementExtensibleImpl();
+    private String fName = null;
+    private QName fTypeName = null;
+
+    /* ***********************************************************************
+     *  Component model methods (HTTPHeader interface), some shared with Element model
+     * ***********************************************************************/
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#getName()
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getName()
+     */
+    public String getName() {
+        return fName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#getTypeDefinition()
+     */
+    public TypeDefinition getTypeDefinition() 
+    {
+        TypeDefinition typeDef = null;
+        Description desc = getDescriptionComponent(getParent());
+        typeDef = desc.getTypeDefinition(fTypeName);
+        return typeDef;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#isRequired()
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#isRequired()
+     */
+    public Boolean isRequired() {
+        return fExtElem.isRequired();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#getParent()
+     */
+    public WSDLComponent getParent() {
+        return (WSDLComponent)fParent;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeader#toElement()
+     */
+    public HTTPHeaderElement toElement() {
+        return this;
+    }
+
+    /* ***********************************************************************
+     *  Element model-only methods (HTTPHeaderElement interface)
+     * ***********************************************************************/
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#setName(java.lang.String)
+     */
+    public void setName(String name) {
+        fName = name;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#setTypeName(javax.xml.namespace.QName)
+     */
+    public void setTypeName(QName qname) {
+        fTypeName = qname;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getTypeName()
+     */
+    public QName getTypeName() {
+        return fTypeName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getType()
+     */
+    public XmlSchemaType getType() 
+    {
+        XmlSchemaType xst = null;
+        DescriptionElement desc = getDescriptionElement(getParentElement());
+        TypesImpl types = (TypesImpl)desc.getTypesElement();
+        if(types != null) {
+            xst = types.getTypeDefinition(fTypeName);
+        }
+        return xst;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#setParentElement(org.apache.woden.wsdl20.xml.WSDLElement)
+     */
+    public void setParentElement(WSDLElement wsdlEl) {
+        fParent = wsdlEl;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getParentElement()
+     */
+    public WSDLElement getParentElement() {
+        return fParent;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#addDocumentationElement(org.apache.woden.wsdl20.xml.DocumentationElement)
+     */
+    public void addDocumentationElement(DocumentationElement docEl) {
+        if(docEl != null) {
+            fDocumentationElements.add(docEl);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPHeaderElement#getDocumentationElements()
+     */
+    public DocumentationElement[] getDocumentationElements() {
+        DocumentationElement[] array = new DocumentationElement[fDocumentationElements.size()];
+        fDocumentationElements.toArray(array);
+        return array;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#setExtensionType(javax.xml.namespace.QName)
+     */
+    public void setExtensionType(QName qname) {
+        fExtElem.setExtensionType(qname);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#getExtensionType()
+     */
+    public QName getExtensionType() {
+        return fExtElem.getExtensionType();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#setRequired(java.lang.Boolean)
+     */
+    public void setRequired(Boolean required) {
+        fExtElem.setRequired(required);
+    }
+
+    /* ***********************************************************************
+     *  Extensibility methods
+     * ***********************************************************************/
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#setExtensionAttribute(javax.xml.namespace.QName, org.apache.woden.xml.XMLAttr)
+     */
+    public void setExtensionAttribute(QName attrType, XMLAttr attr) {
+        fAttrExt.setExtensionAttribute(attrType, attr);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttribute(javax.xml.namespace.QName)
+     */
+    public XMLAttr getExtensionAttribute(QName attrType) {
+        return fAttrExt.getExtensionAttribute(attrType);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributesForNamespace(java.net.URI)
+     */
+    public XMLAttr[] getExtensionAttributesForNamespace(URI namespace) {
+        return fAttrExt.getExtensionAttributesForNamespace(namespace);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#getExtensionAttributes()
+     */
+    public XMLAttr[] getExtensionAttributes() {
+        return fAttrExt.getExtensionAttributes();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.AttributeExtensible#hasExtensionAttributesForNamespace(java.net.URI)
+     */
+    public boolean hasExtensionAttributesForNamespace(URI namespace) {
+        return fAttrExt.hasExtensionAttributesForNamespace(namespace);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#addExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
+     */
+    public void addExtensionElement(ExtensionElement extEl) {
+        fElemExt.addExtensionElement(extEl);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#removeExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
+     */
+    public void removeExtensionElement(ExtensionElement extEl) {
+        fElemExt.removeExtensionElement(extEl);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElements()
+     */
+    public ExtensionElement[] getExtensionElements() {
+        return fElemExt.getExtensionElements();
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElementsOfType(javax.xml.namespace.QName)
+     */
+    public ExtensionElement[] getExtensionElementsOfType(QName extType) {
+        return fElemExt.getExtensionElementsOfType(extType);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#hasExtensionElementsForNamespace(java.net.URI)
+     */
+    public boolean hasExtensionElementsForNamespace(URI namespace) {
+        return fElemExt.hasExtensionElementsForNamespace(namespace);
+    }
+
+    /* ************************************************************
+     *  Non-API implementation methods
+     * ************************************************************/
+    
+    /*
+     * This method traverses up the element graph to get the root <description>.
+     * TODO consider its usefulness to user-defined extensions and whether to refactor it.
+     * e.g. declared in ExtensionElement and implemented in ExtensionElementImpl
+     */
+    private DescriptionElement getDescriptionElement(WSDLElement wsdlElem)
+    {
+        if(wsdlElem instanceof BindingImpl) 
+        {
+            return (DescriptionElement) ((NestedElement)wsdlElem).getParentElement();
+        }
+        else
+        {
+            WSDLElement parentElem = ((NestedElement)wsdlElem).getParentElement();
+            return getDescriptionElement(parentElem);
+        }
+    }
+    
+    /* 
+     * TODO ditto previous comment about possibly refactoring this for user-defined extensions to reuse. 
+     */
+    private Description getDescriptionComponent(WSDLComponent wsdlComp)
+    {
+        if(wsdlComp instanceof BindingImpl) 
+        {
+            return ((BindingImpl)wsdlComp).getDescriptionComponent();
+        }
+        else 
+        {
+            WSDLComponent parentComp = ((NestedComponent)wsdlComp).getParent();
+            return getDescriptionComponent(parentComp);
+        } 
+    }
+    
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java Thu Aug 23 04:01:23 2007
@@ -1,53 +1,53 @@
-/**
+/**
  * 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.internal.wsdl20.extensions.rpc;
-
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants for predefined WSDL RPC extensions.
- * 
- * @author Arthur Ryman (ryman@ca.ibm.com)
- */
-public class RPCConstants {
-
-	// Namespace URI
-
-	public static final String NS_URI_RPC = "http://www.w3.org/ns/wsdl/rpc";
-	
-	// Style URI
-
-	public static final String STYLE_URI_RPC = "http://www.w3.org/ns/wsdl/style/rpc";
-    public static final URI URI_STYLE_RPC = URI.create("http://www.w3.org/ns/wsdl/style/rpc");
-	
-	// Attribute name
-
-	public static final String ATTR_SIGNATURE = "signature";
-
-	// Prefix
-
-	public static final String PFX_RPC = "wrpc";
-
-	// Qualified attribute name
-
-	public static final QName Q_ATTR_RPC_SIGNATURE = new QName(
-			NS_URI_RPC, ATTR_SIGNATURE, PFX_RPC);
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.rpc;
+
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Constants for predefined WSDL RPC extensions.
+ * 
+ * @author Arthur Ryman (ryman@ca.ibm.com)
+ */
+public class RPCConstants {
+
+	// Namespace URI
+
+	public static final String NS_URI_RPC = "http://www.w3.org/ns/wsdl/rpc";
+	
+	// Style URI
+
+	public static final String STYLE_URI_RPC = "http://www.w3.org/ns/wsdl/style/rpc";
+    public static final URI URI_STYLE_RPC = URI.create("http://www.w3.org/ns/wsdl/style/rpc");
+	
+	// Attribute name
+
+	public static final String ATTR_SIGNATURE = "signature";
+
+	// Prefix
+
+	public static final String PFX_RPC = "wrpc";
+
+	// Qualified attribute name
+
+	public static final QName Q_ATTR_RPC_SIGNATURE = new QName(
+			NS_URI_RPC, ATTR_SIGNATURE, PFX_RPC);
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCInterfaceOperationExtensionsImpl.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCInterfaceOperationExtensionsImpl.java?rev=568932&r1=568931&r2=568932&view=diff
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCInterfaceOperationExtensionsImpl.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCInterfaceOperationExtensionsImpl.java Thu Aug 23 04:01:23 2007
@@ -1,52 +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.internal.wsdl20.extensions.rpc;
-
-import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
-import org.apache.woden.wsdl20.extensions.rpc.Argument;
-import org.apache.woden.wsdl20.extensions.rpc.RPCInterfaceOperationExtensions;
-import org.apache.woden.xml.ArgumentArrayAttr;
-
-/**
- * This class defines the properties from the WSDL RPC extensions namespace
- * added to the WSDL <code>Interface Operation</code> component as part of the
- * WSDL RPC extension defined by the WSDL 2.0 spec.
- * 
- * @author Arthur Ryman (ryman@ca.ibm.com)
- */
-
-public class RPCInterfaceOperationExtensionsImpl extends
-		ComponentExtensionsImpl implements RPCInterfaceOperationExtensions {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.woden.wsdl20.extensions.rpc.RPCInterfaceOperationExtensions#getRPCSignature()
-	 */
-	public Argument[] getRPCSignature() {
-
-		ArgumentArrayAttr args = (ArgumentArrayAttr) fParentElement
-				.getExtensionAttribute(RPCConstants.Q_ATTR_RPC_SIGNATURE);
-
-		if (args == null)
-			return new Argument[0];
-
-		return args.getArgumentArray();
-	}
-
-}
+ * 
+ *     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.internal.wsdl20.extensions.rpc;
+
+import org.apache.woden.internal.wsdl20.extensions.ComponentExtensionsImpl;
+import org.apache.woden.wsdl20.extensions.rpc.Argument;
+import org.apache.woden.wsdl20.extensions.rpc.RPCInterfaceOperationExtensions;
+import org.apache.woden.xml.ArgumentArrayAttr;
+
+/**
+ * This class defines the properties from the WSDL RPC extensions namespace
+ * added to the WSDL <code>Interface Operation</code> component as part of the
+ * WSDL RPC extension defined by the WSDL 2.0 spec.
+ * 
+ * @author Arthur Ryman (ryman@ca.ibm.com)
+ */
+
+public class RPCInterfaceOperationExtensionsImpl extends
+		ComponentExtensionsImpl implements RPCInterfaceOperationExtensions {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.rpc.RPCInterfaceOperationExtensions#getRPCSignature()
+	 */
+	public Argument[] getRPCSignature() {
+
+		ArgumentArrayAttr args = (ArgumentArrayAttr) fParentElement
+				.getExtensionAttribute(RPCConstants.Q_ATTR_RPC_SIGNATURE);
+
+		if (args == null)
+			return new Argument[0];
+
+		return args.getArgumentArray();
+	}
+
+}

Propchange: incubator/woden/trunk/java/src/org/apache/woden/internal/wsdl20/extensions/rpc/RPCInterfaceOperationExtensionsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org