ws-woden-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sag...@apache.org
Subject svn commit: r809831 [6/10] - in /webservices/woden/trunk/java/woden-commons: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/woden/ src/main/java/org/apache/woden/internal/ src/main/java/org/apache...
Date Tue, 01 Sep 2009 05:49:07 GMT
Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ElementExtensibleImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ElementExtensibleImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ElementExtensibleImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ElementExtensibleImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,114 @@
+/**
+ * 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;
+
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.wsdl20.extensions.ElementExtensible;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+
+/**
+ * Common code for handling extension elements. 
+ * Can be reused by inheritance or by delegation.
+ * 
+ * @author jkaputin@ws.apache.org
+ */
+public class ElementExtensibleImpl implements ElementExtensible 
+{
+    private List fExtElements = new Vector();
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#addExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
+     */
+    public void addExtensionElement(ExtensionElement extEl) 
+    {
+        if(extEl != null) {
+            fExtElements.add(extEl);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#removeExtensionElement(org.apache.woden.wsdl20.extensions.ExtensionElement)
+     */
+    public void removeExtensionElement(ExtensionElement extEl) 
+    {
+        fExtElements.remove(extEl);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElements()
+     */
+    public ExtensionElement[] getExtensionElements() 
+    {
+        ExtensionElement[] array = new ExtensionElement[fExtElements.size()];
+        fExtElements.toArray(array);
+        return array;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#getExtensionElementsOfType(javax.xml.namespace.QName)
+     */
+    public ExtensionElement[] getExtensionElementsOfType(QName extType) 
+    {
+        List elements = new Vector();
+        
+        if(extType != null)
+        {
+            for(Iterator i=fExtElements.iterator(); i.hasNext();)
+            {
+                ExtensionElement extElem = (ExtensionElement)i.next();
+                if(extElem.getExtensionType().equals(extType))
+                {
+                    elements.add(extElem);
+                }
+            }
+        }
+        
+        ExtensionElement[] array = new ExtensionElement[elements.size()];
+        elements.toArray(array);
+        return array;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ElementExtensible#hasExtensionElementsForNamespace(javax.net.URI)
+     */
+    public boolean hasExtensionElementsForNamespace(URI namespace)
+    {
+        boolean result = false;
+        if(namespace != null)
+        {
+            String extensionNS = namespace.toString();
+            for(Iterator i=fExtElements.iterator(); i.hasNext();)
+            {
+                ExtensionElement extElem = (ExtensionElement)i.next();
+                if(extensionNS.equals(extElem.getExtensionType().getNamespaceURI()))
+                {
+                    result = true;
+                    break;
+                }
+            }
+        }
+        return result;
+    }
+
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ExtensionElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ExtensionElementImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ExtensionElementImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/ExtensionElementImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +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;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+
+/**
+ * Common code for extension elements. 
+ * 
+ * @author jkaputin@ws.apache.org
+ */
+public class ExtensionElementImpl implements ExtensionElement 
+{
+    private QName fExtElementType = null;
+    private Boolean fRequired = null;
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#setExtensionType(javax.xml.namespace.QName)
+     */
+    public void setExtensionType(QName qname) {
+        fExtElementType = qname;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#getExtensionType()
+     */
+    public QName getExtensionType() {
+        return fExtElementType;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#setRequired(java.lang.Boolean)
+     */
+    public void setRequired(Boolean required) {
+        fRequired = required;
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ExtensionElement#isRequired()
+     */
+    public Boolean isRequired() {
+        return fRequired;
+    }
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/InterfaceOperationExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/InterfaceOperationExtensionsImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/InterfaceOperationExtensionsImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/InterfaceOperationExtensionsImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,91 @@
+/**
+ * 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;
+
+import java.net.URI;
+
+import org.apache.woden.ErrorReporter;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.BaseComponentExtensionContext;
+import org.apache.woden.wsdl20.extensions.WSDLExtensionConstants;
+import org.apache.woden.wsdl20.extensions.ExtensionProperty;
+import org.apache.woden.wsdl20.extensions.InterfaceOperationExtensions;
+import org.apache.woden.wsdl20.extensions.rpc.RPCConstants;
+import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.BooleanAttr;
+
+/**
+ * This class defines the properties from the WSDL extensions namespace added to
+ * the WSDL <code>Interface Operation</code> component as part of the WSDL
+ * extension defined by the WSDL 2.0 spec.
+ * 
+ * @author Arthur Ryman (ryman@ca.ibm.com)
+ */
+
+public class InterfaceOperationExtensionsImpl extends BaseComponentExtensionContext
+		implements InterfaceOperationExtensions {
+
+    public InterfaceOperationExtensionsImpl(WSDLComponent parent, 
+            URI extNamespace, ErrorReporter errReporter) {
+        
+        super(parent, extNamespace, errReporter);
+    }
+    
+    /* ************************************************************
+     *  Methods declared by ComponentExtensionContext
+     *  
+     *  These are the abstract methods inherited from BaseComponentExtensionContext,
+     *  to be implemented by this subclass.
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperties()
+     */
+    public ExtensionProperty[] getProperties() {
+        return new ExtensionProperty[] {getProperty(WSDLExtensionConstants.PROP_SAFE)};
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperty(java.lang.String)
+     */
+    public ExtensionProperty getProperty(String propertyName) {
+        
+        if(WSDLExtensionConstants.PROP_SAFE.equals(propertyName) ) {
+            BooleanAttr safe = (BooleanAttr) ((WSDLElement)getParent())
+            .getExtensionAttribute(WSDLExtensionConstants.Q_ATTR_SAFE);
+            return newExtensionProperty(WSDLExtensionConstants.PROP_SAFE, 
+                    safe != null ? safe.getBoolean() : Boolean.FALSE);
+        } else {
+            return null; //the specified property name does not exist
+        }
+    }
+    
+    /* ************************************************************
+     *  Additional methods declared by InterfaceOperationExtensions
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.InterfaceOperationExtensionContext#isSafe()
+     */
+	public boolean isSafe() {
+		Boolean safe = (Boolean)getProperty(WSDLExtensionConstants.PROP_SAFE).getContent();
+		return safe == Boolean.TRUE ? true : false;
+	}
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,381 @@
+/**
+ * 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;
+
+import java.util.Enumeration;
+import java.util.StringTokenizer;
+
+import org.apache.woden.ErrorReporter;
+import org.apache.woden.WSDLException;
+import org.apache.woden.internal.util.PropertyUtils;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingFaultExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingOperationExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPEndpointExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPHeaderDeserializer;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPHeaderImpl;
+import org.apache.woden.internal.wsdl20.extensions.rpc.RPCInterfaceOperationExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingFaultExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingFaultReferenceExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingMessageReferenceExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingOperationExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPEndpointExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockDeserializer;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPHeaderBlockImpl;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPModuleDeserializer;
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPModuleImpl;
+import org.apache.woden.internal.xml.ArgumentArrayAttrImpl;
+import org.apache.woden.internal.xml.BooleanAttrImpl;
+import org.apache.woden.internal.xml.HTTPAuthenticationSchemeAttrImpl;
+import org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl;
+import org.apache.woden.internal.xml.QNameListOrTokenAnyAttrImpl;
+import org.apache.woden.internal.xml.QNameOrTokenAnyAttrImpl;
+import org.apache.woden.internal.xml.StringAttrImpl;
+import org.apache.woden.internal.xml.URIAttrImpl;
+import org.apache.woden.wsdl20.Binding;
+import org.apache.woden.wsdl20.BindingFault;
+import org.apache.woden.wsdl20.BindingFaultReference;
+import org.apache.woden.wsdl20.BindingMessageReference;
+import org.apache.woden.wsdl20.BindingOperation;
+import org.apache.woden.wsdl20.Endpoint;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.extensions.WSDLExtensionConstants;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistrar;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
+import org.apache.woden.wsdl20.extensions.http.HTTPConstants;
+import org.apache.woden.wsdl20.extensions.rpc.RPCConstants;
+import org.apache.woden.wsdl20.extensions.soap.SOAPConstants;
+import org.apache.woden.wsdl20.xml.BindingElement;
+import org.apache.woden.wsdl20.xml.BindingFaultElement;
+import org.apache.woden.wsdl20.xml.BindingFaultReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
+import org.apache.woden.wsdl20.xml.BindingOperationElement;
+import org.apache.woden.wsdl20.xml.EndpointElement;
+import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
+
+/**
+ * This class extends ExtensionRegistry and pre-registers
+ * serializers/deserializers for the SOAP, HTTP and MIME extensions. Java impl
+ * types are also registered for all the SOAP and HTTP extensions defined in the
+ * WSDL 2.0 Spec.
+ * 
+ * This class was copied from WSDL4J and modified for Woden.
+ * 
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ * @author John Kaputin (jkaputin@apache.org) - Woden changes
+ * @author Arthur Ryman (ryman@ca.ibm.com, arthur.ryman@gmail.com) - added
+ *         wsdlx:safe and wrpc:signature to Interface Operation, - added
+ *         HTTPAuthenticationSchemeAttrImpl
+ */
+public class PopulatedExtensionRegistry extends ExtensionRegistry {
+
+	public PopulatedExtensionRegistry(ErrorReporter errorReporter) throws WSDLException {
+        
+        super(errorReporter);
+        
+		// ------------ Default type for unregistered extension attributes
+		// ------------
+
+		/*
+		 * If a default XMLAttr type other than UnknownAttr is to be used for
+		 * unregisterd attributes, uncomment this code and replace <someAttr>
+		 * with the default type. registerExtAttributeType(WSDLElement.class,
+		 * new QName("http://ws.apache.org/woden", "DefaultAttr"),
+		 * <someAttr>Impl.class);
+		 */
+
+		// ------------ WSDL extension attributes ------------
+		registerExtAttributeType(InterfaceOperationElement.class,
+				WSDLExtensionConstants.Q_ATTR_SAFE, BooleanAttrImpl.class);
+
+		// ------------ WSDL Component Extensions ------------
+
+		registerComponentExtension(InterfaceOperation.class,
+				WSDLExtensionConstants.NS_URI_WSDL_EXTENSIONS,
+				InterfaceOperationExtensionsImpl.class);
+
+		// ------------ RPC extension attributes ------------
+
+		registerExtAttributeType(InterfaceOperationElement.class,
+				RPCConstants.Q_ATTR_RPC_SIGNATURE, ArgumentArrayAttrImpl.class);
+
+		// ------------ RPC Component Extensions ------------
+		registerComponentExtension(InterfaceOperation.class,
+		        RPCConstants.NS_URI_RPC,
+				RPCInterfaceOperationExtensionsImpl.class);
+
+		// ------------ SOAP extension attributes ------------
+
+		registerExtAttributeType(BindingElement.class,
+				SOAPConstants.Q_ATTR_SOAP_VERSION, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingElement.class,
+				SOAPConstants.Q_ATTR_SOAP_PROTOCOL, URIAttrImpl.class);
+
+		registerExtAttributeType(BindingElement.class,
+				SOAPConstants.Q_ATTR_SOAP_MEPDEFAULT, URIAttrImpl.class);
+
+		registerExtAttributeType(BindingFaultElement.class,
+				SOAPConstants.Q_ATTR_SOAP_CODE, QNameOrTokenAnyAttrImpl.class);
+
+		registerExtAttributeType(BindingFaultElement.class,
+				SOAPConstants.Q_ATTR_SOAP_SUBCODES,
+				QNameListOrTokenAnyAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				SOAPConstants.Q_ATTR_SOAP_MEP, URIAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				SOAPConstants.Q_ATTR_SOAP_ACTION, URIAttrImpl.class);
+
+		// ------------ SOAPModule extension elements ------------
+
+		SOAPModuleDeserializer soapModuleDeser = new SOAPModuleDeserializer();
+
+		// registerSerializer(BindingElement.class,
+		// SOAPConstants.Q_ELEM_SOAP_MODULE,
+		// <serializer to be implemented>);
+		registerDeserializer(BindingElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, soapModuleDeser);
+		registerExtElementType(BindingElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, SOAPModuleImpl.class);
+
+		registerDeserializer(BindingFaultElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, soapModuleDeser);
+		registerExtElementType(BindingFaultElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, SOAPModuleImpl.class);
+
+		registerDeserializer(BindingOperationElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, soapModuleDeser);
+		registerExtElementType(BindingOperationElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, SOAPModuleImpl.class);
+
+		registerDeserializer(BindingMessageReferenceElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, soapModuleDeser);
+		registerExtElementType(BindingMessageReferenceElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, SOAPModuleImpl.class);
+
+		registerDeserializer(BindingFaultReferenceElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, soapModuleDeser);
+		registerExtElementType(BindingFaultReferenceElement.class,
+				SOAPConstants.Q_ELEM_SOAP_MODULE, SOAPModuleImpl.class);
+
+		// ------------ SOAPHeaderBlock extension elements ------------
+
+		SOAPHeaderBlockDeserializer soapHeaderBlockDeser = new SOAPHeaderBlockDeserializer();
+
+		// registerSerializer(BindingFaultElement.class,
+		// SOAPConstants.Q_ELEM_SOAP_HEADER,
+		// <serializer to be implemented>);
+		registerDeserializer(BindingFaultElement.class,
+				SOAPConstants.Q_ELEM_SOAP_HEADER, soapHeaderBlockDeser);
+		registerExtElementType(BindingFaultElement.class,
+				SOAPConstants.Q_ELEM_SOAP_HEADER, SOAPHeaderBlockImpl.class);
+
+		// registerSerializer(BindingMessageReferenceElement.class,
+		// SOAPConstants.Q_ELEM_SOAP_HEADER,
+		// <serializer to be implemented>);
+		registerDeserializer(BindingMessageReferenceElement.class,
+				SOAPConstants.Q_ELEM_SOAP_HEADER, soapHeaderBlockDeser);
+		registerExtElementType(BindingMessageReferenceElement.class,
+				SOAPConstants.Q_ELEM_SOAP_HEADER, SOAPHeaderBlockImpl.class);
+
+		// ------------ SOAP Component Extensions ------------
+
+		registerComponentExtension(Binding.class,
+				SOAPConstants.NS_URI_SOAP,
+				SOAPBindingExtensionsImpl.class);
+
+		registerComponentExtension(BindingFault.class,
+		        SOAPConstants.NS_URI_SOAP,
+				SOAPBindingFaultExtensionsImpl.class);
+
+		registerComponentExtension(BindingOperation.class,
+		        SOAPConstants.NS_URI_SOAP,
+				SOAPBindingOperationExtensionsImpl.class);
+
+		registerComponentExtension(BindingMessageReference.class,
+		        SOAPConstants.NS_URI_SOAP,
+				SOAPBindingMessageReferenceExtensionsImpl.class);
+
+		registerComponentExtension(BindingFaultReference.class,
+		        SOAPConstants.NS_URI_SOAP,
+				SOAPBindingFaultReferenceExtensionsImpl.class);
+
+        registerComponentExtension(Endpoint.class,
+                SOAPConstants.NS_URI_SOAP,
+                SOAPEndpointExtensionsImpl.class);
+
+		// ------------ HTTP extension attributes ------------
+
+		registerExtAttributeType(BindingElement.class,
+				HTTPConstants.Q_ATTR_METHOD_DEFAULT, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingElement.class,
+				HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT,
+				StringAttrImpl.class);
+
+		registerExtAttributeType(BindingElement.class,
+				HTTPConstants.Q_ATTR_COOKIES, BooleanAttrImpl.class);
+
+		registerExtAttributeType(BindingElement.class,
+				HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT,
+				StringAttrImpl.class);
+
+		registerExtAttributeType(BindingFaultElement.class,
+				HTTPConstants.Q_ATTR_CODE, IntOrTokenAnyAttrImpl.class);
+
+		registerExtAttributeType(BindingFaultElement.class,
+				HTTPConstants.Q_ATTR_CONTENT_ENCODING, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_LOCATION, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_IGNORE_UNCITED, BooleanAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_METHOD, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_INPUT_SERIALIZATION, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_OUTPUT_SERIALIZATION, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_FAULT_SERIALIZATION, StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR,
+				StringAttrImpl.class);
+
+		registerExtAttributeType(BindingOperationElement.class,
+				HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT,
+				StringAttrImpl.class);
+
+		registerExtAttributeType(BindingMessageReferenceElement.class,
+				HTTPConstants.Q_ATTR_CONTENT_ENCODING, StringAttrImpl.class);
+
+		registerExtAttributeType(EndpointElement.class,
+				HTTPConstants.Q_ATTR_AUTHENTICATION_SCHEME,
+				HTTPAuthenticationSchemeAttrImpl.class);
+
+		registerExtAttributeType(EndpointElement.class,
+				HTTPConstants.Q_ATTR_AUTHENTICATION_REALM, StringAttrImpl.class);
+
+		// ------------ HTTPHeader extension elements ------------
+
+		HTTPHeaderDeserializer httpHeaderDeser = new HTTPHeaderDeserializer();
+
+		// registerSerializer(BindingFaultElement.class,
+		// HTTPConstants.Q_ELEM_HTTP_HEADER,
+		// <serializer to be implemented>);
+		registerDeserializer(BindingFaultElement.class,
+				HTTPConstants.Q_ELEM_HTTP_HEADER, httpHeaderDeser);
+		registerExtElementType(BindingFaultElement.class,
+				HTTPConstants.Q_ELEM_HTTP_HEADER, HTTPHeaderImpl.class);
+
+        // registerSerializer(BindingMessageReferenceElement.class,
+        // HTTPConstants.Q_ELEM_HTTP_HEADER,
+        // <serializer to be implemented>);
+        registerDeserializer(BindingMessageReferenceElement.class,
+                HTTPConstants.Q_ELEM_HTTP_HEADER, httpHeaderDeser);
+        registerExtElementType(BindingMessageReferenceElement.class,
+                HTTPConstants.Q_ELEM_HTTP_HEADER, HTTPHeaderImpl.class);
+
+		// ------------ HTTP Component Extensions ------------
+
+		registerComponentExtension(Binding.class,
+				HTTPConstants.NS_URI_HTTP,
+				HTTPBindingExtensionsImpl.class);
+
+		registerComponentExtension(BindingFault.class,
+				HTTPConstants.NS_URI_HTTP,
+				HTTPBindingFaultExtensionsImpl.class);
+
+		registerComponentExtension(BindingOperation.class,
+				HTTPConstants.NS_URI_HTTP,
+				HTTPBindingOperationExtensionsImpl.class);
+
+		registerComponentExtension(BindingMessageReference.class,
+				HTTPConstants.NS_URI_HTTP,
+				HTTPBindingMessageReferenceExtensionsImpl.class);
+
+		registerComponentExtension(Endpoint.class,
+				HTTPConstants.NS_URI_HTTP,
+				HTTPEndpointExtensionsImpl.class);
+        
+        //Register other, user-defined WSDL extensions.
+        registerExtensions();
+	}
+    
+    /* 
+     * Registers WSDL extensions with this extension registry,
+     * via the ExtensionRegistrar callback interface.
+     * 
+     */
+    private void registerExtensions() throws WSDLException {
+        Enumeration registrarNames = getRegistrarNames();
+        if (registrarNames != null) {
+            while (registrarNames.hasMoreElements()) {
+                String extensionRegistrarClassName = ((String)registrarNames.nextElement()).trim();
+                try {
+                    Class clazz = Class.forName(extensionRegistrarClassName);
+                    ExtensionRegistrar registrar = (ExtensionRegistrar)clazz.newInstance();
+                    registrar.registerExtensions(this);
+                } catch (ClassNotFoundException cnfe) {
+                    ErrorReporter er = getErrorReporter();
+                    er.reportError(
+                            null,
+                            "WSDL020",
+                            new Object[] {extensionRegistrarClassName}, 
+                            ErrorReporter.SEVERITY_ERROR, 
+                            cnfe);
+                } catch (ClassCastException cce) {
+                    getErrorReporter().reportError(
+                            null,
+                            "WSDL021",
+                            new Object[] {extensionRegistrarClassName}, 
+                            ErrorReporter.SEVERITY_ERROR, 
+                            cce);
+                } catch (Exception e) {
+                    getErrorReporter().reportError(
+                            null,
+                            "WSDL022",
+                            new Object[] {extensionRegistrarClassName}, 
+                            ErrorReporter.SEVERITY_ERROR, 
+                            e);
+                }
+            }
+        }
+    }
+
+    /*
+     * Returns an Enumeration of ExtensionRegistrar class names.
+     * The <code>REGISTRAR_PROPERTY</code> property contains a comma-separated list of
+     * ExtensionRegistrar class names.
+     * @return an Enumeration of ExtensionRegistrar class names.
+     */
+    private Enumeration getRegistrarNames() {
+        String registrarNames = PropertyUtils.findProperty(ExtensionRegistry.REGISTRAR_PROPERTY);
+        return registrarNames == null ? null : new StringTokenizer(registrarNames, ",");
+    }
+
+}
\ No newline at end of file

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingExtensionsImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingExtensionsImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingExtensionsImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,138 @@
+/**
+ * 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.ErrorReporter;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.BaseComponentExtensionContext;
+import org.apache.woden.wsdl20.extensions.ExtensionProperty;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPConstants;
+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>Binding</code> component as part 
+ * of the HTTP binding extension defined by the WSDL 2.0 spec. 
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ */
+public class HTTPBindingExtensionsImpl extends BaseComponentExtensionContext
+                                       implements HTTPBindingExtensions 
+{
+
+    public HTTPBindingExtensionsImpl(WSDLComponent parent, 
+            URI extNamespace, ErrorReporter errReporter) {
+        
+        super(parent, extNamespace, errReporter);
+    }
+    
+    /* ************************************************************
+     *  Methods declared by ComponentExtensionContext
+     *  
+     *  These are the abstract methods inherited from BaseComponentExtensionContext,
+     *  to be implemented by this subclass.
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperties()
+     */
+    public ExtensionProperty[] getProperties() {
+        
+        return new ExtensionProperty[] {
+                getProperty(HTTPConstants.PROP_HTTP_METHOD_DEFAULT),
+                getProperty(HTTPConstants.PROP_HTTP_QUERY_PARAMETER_SEPARATOR_DEFAULT),
+                getProperty(HTTPConstants.PROP_HTTP_COOKIES),
+                getProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING_DEFAULT)};
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperty(java.lang.String)
+     */
+    public ExtensionProperty getProperty(String propertyName) {
+        
+        if(HTTPConstants.PROP_HTTP_METHOD_DEFAULT.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_METHOD_DEFAULT, getHttpMethodDefault());
+            
+        } else if(HTTPConstants.PROP_HTTP_QUERY_PARAMETER_SEPARATOR_DEFAULT.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_QUERY_PARAMETER_SEPARATOR_DEFAULT, 
+                    getHttpQueryParameterSeparatorDefault());
+            
+        } else if(HTTPConstants.PROP_HTTP_COOKIES.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_COOKIES, isHttpCookies());
+            
+        } else if(HTTPConstants.PROP_HTTP_CONTENT_ENCODING_DEFAULT.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING_DEFAULT, getHttpContentEncodingDefault());
+            
+        } else {
+            return null; //the specified property name does not exist
+        }
+        
+    }
+    
+    /* ************************************************************
+     *  Additional methods declared by HTTPBindingExtensions
+     * ************************************************************/
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions#getHttpMethodDefault()
+     */
+    public String getHttpMethodDefault() 
+    {
+        StringAttr methodDef = (StringAttr) ((WSDLElement)getParent())
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_METHOD_DEFAULT);
+        return methodDef != null ? methodDef.getString() : null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions#getHttpQueryParameterSeparatorDefault()
+     */
+    public String getHttpQueryParameterSeparatorDefault() 
+    {
+        //TODO monitor ws-desc proposal 19May06 on changing handling of defaults in spec Part 2
+        StringAttr qpsDef = (StringAttr) ((WSDLElement)getParent())
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR_DEFAULT);
+        return qpsDef != null ? qpsDef.getString() : HTTPConstants.QUERY_SEP_AMPERSAND;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions#isHttpCookies()
+     */
+    public Boolean isHttpCookies() 
+    {
+        BooleanAttr cookiesUsed = (BooleanAttr) ((WSDLElement)getParent())
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_COOKIES);
+        return cookiesUsed != null ? cookiesUsed.getBoolean() : new Boolean(false); //defaults to false if omitted
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions#getHttpContentEncodingDefault()
+     */
+    public String getHttpContentEncodingDefault() 
+    {
+        StringAttr ceDef = (StringAttr) ((WSDLElement)getParent())
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING_DEFAULT);
+        return ceDef != null ? ceDef.getString() : null;
+    }
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingFaultExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingFaultExtensionsImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingFaultExtensionsImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingFaultExtensionsImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,157 @@
+/**
+ * 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.ErrorReporter;
+import org.apache.woden.internal.xml.IntOrTokenAnyAttrImpl;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.BaseComponentExtensionContext;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.ExtensionProperty;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPConstants;
+import org.apache.woden.wsdl20.extensions.http.HTTPErrorStatusCode;
+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>BindingFault</code> component as part 
+ * of the HTTP binding extension defined by the WSDL 2.0 spec. 
+ * 
+ * @author John Kaputin (jkaputin@apache.org)
+ */
+public class HTTPBindingFaultExtensionsImpl extends BaseComponentExtensionContext
+                                            implements HTTPBindingFaultExtensions 
+{
+
+    public HTTPBindingFaultExtensionsImpl(WSDLComponent parent, 
+            URI extNamespace, ErrorReporter errReporter) {
+        
+        super(parent, extNamespace, errReporter);
+    }
+    
+    /* ************************************************************
+     *  Methods declared by ComponentExtensionContext
+     *  
+     *  These are the abstract methods inherited from BaseComponentExtensionContext,
+     *  to be implemented by this subclass.
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperties()
+     */
+    public ExtensionProperty[] getProperties() {
+        
+        return new ExtensionProperty[] {
+                getProperty(HTTPConstants.PROP_HTTP_ERROR_STATUS_CODE),
+                getProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING),
+                getProperty(HTTPConstants.PROP_HTTP_HEADERS)};
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperty(java.lang.String)
+     */
+    public ExtensionProperty getProperty(String propertyName) {
+        
+        if(HTTPConstants.PROP_HTTP_ERROR_STATUS_CODE.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_ERROR_STATUS_CODE, getHttpErrorStatusCode());
+            
+        } else if(HTTPConstants.PROP_HTTP_CONTENT_ENCODING.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING, getHttpContentEncoding());
+            
+        } else if(HTTPConstants.PROP_HTTP_HEADERS.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_HEADERS, getHttpHeaders());
+            
+        } else {
+            return null; //the specified property name does not exist
+        }
+        
+    }
+    
+    /* ************************************************************
+     *  Additional methods declared by HTTPBindingFaultExtensions
+     * ************************************************************/
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions#getHttpErrorStatusCode()
+     */
+    public HTTPErrorStatusCode getHttpErrorStatusCode() 
+    {
+        /* IntOrTokenAnyAttrImpl is the class registered for this extension attribute. Use this type 
+         * here, rather than the IntOrTokenAttr interface, to guarantee that if the code contains an 
+         * xs:token it is of type #any.
+         */
+        IntOrTokenAnyAttrImpl code = (IntOrTokenAnyAttrImpl) ((WSDLElement) getParent())
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_CODE);
+        
+        if(code == null)
+        {
+            //defaults to xs:token #any if the attribute is omitted from the WSDL.
+            return HTTPErrorStatusCode.ANY;
+        }
+        else if(code.isToken()) 
+        {
+            //if IntOrTokenAnyAttrImpl contains a token then is must be '#any'
+            return HTTPErrorStatusCode.ANY;
+        }
+        else if(code.isInt())
+        {
+            return new HTTPErrorStatusCode(code.getInt());
+        }
+        else
+        {
+            //the whttp:code attribute contains an invalid value (i.e. not an xs:QName or the xs:token #any)
+            //TODO confirm if this should be represented in the Component model as a null
+            return null;
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions#getHttpContentEncoding()
+     * 
+     */
+    public String getHttpContentEncoding() 
+    {
+        String ce = null;
+        StringAttr contEncoding = (StringAttr) ((WSDLElement) getParent())
+            .getExtensionAttribute(HTTPConstants.Q_ATTR_CONTENT_ENCODING);
+        if(contEncoding != null) {
+            ce = contEncoding.getString();
+        }
+        return ce; 
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions#getHttpHeaders()
+     */
+    public HTTPHeader[] getHttpHeaders() 
+    {
+        ExtensionElement[] extEls =  ((WSDLElement) getParent())
+            .getExtensionElementsOfType(HTTPConstants.Q_ELEM_HTTP_HEADER);
+        int len = extEls.length;
+        HTTPHeader[] httpHeaders = new HTTPHeader[len];
+        System.arraycopy(extEls, 0, httpHeaders, 0, len);
+        return httpHeaders;
+    }
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingMessageReferenceExtensionsImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,114 @@
+/**
+ * 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.ErrorReporter;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.BaseComponentExtensionContext;
+import org.apache.woden.wsdl20.extensions.ExtensionElement;
+import org.apache.woden.wsdl20.extensions.ExtensionProperty;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPConstants;
+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 BaseComponentExtensionContext 
+                                          implements HTTPBindingMessageReferenceExtensions 
+{
+
+    public HTTPBindingMessageReferenceExtensionsImpl(WSDLComponent parent, 
+            URI extNamespace, ErrorReporter errReporter) {
+        
+        super(parent, extNamespace, errReporter);
+    }
+    
+    /* ************************************************************
+     *  Methods declared by ComponentExtensionContext
+     *  
+     *  These are the abstract methods inherited from BaseComponentExtensionContext,
+     *  to be implemented by this subclass.
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperties()
+     */
+    public ExtensionProperty[] getProperties() {
+        
+        return new ExtensionProperty[] {
+                getProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING),
+                getProperty(HTTPConstants.PROP_HTTP_HEADERS)};
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperty(java.lang.String)
+     */
+    public ExtensionProperty getProperty(String propertyName) {
+        
+        if(HTTPConstants.PROP_HTTP_CONTENT_ENCODING.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING, getHttpContentEncoding());
+            
+        } else if(HTTPConstants.PROP_HTTP_HEADERS.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_HEADERS, getHttpHeaders());
+            
+        } else {
+            return null; //the specified property name does not exist
+        }
+        
+    }
+    
+    /* ************************************************************
+     *  Additional methods declared by HTTPBindingMessageReferenceExtensions
+     * ************************************************************/
+    
+    /* (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions#getHttpContentEncoding()
+     * 
+     */
+    public String getHttpContentEncoding() 
+    {
+        StringAttr contentEncoding = (StringAttr) ((WSDLElement) getParent())
+            .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)getParent())
+            .getExtensionElementsOfType(HTTPConstants.Q_ELEM_HTTP_HEADER);
+        int len = extEls.length;
+        HTTPHeader[] httpHeaders = new HTTPHeader[len];
+        System.arraycopy(extEls, 0, httpHeaders, 0, len);
+        return httpHeaders;
+    }
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,337 @@
+/**
+ * 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.ErrorReporter;
+import org.apache.woden.wsdl20.Binding;
+import org.apache.woden.wsdl20.BindingOperation;
+import org.apache.woden.wsdl20.InterfaceOperation;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.BaseComponentExtensionContext;
+import org.apache.woden.wsdl20.extensions.WSDLExtensionConstants;
+import org.apache.woden.wsdl20.extensions.ExtensionProperty;
+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.HTTPConstants;
+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 BaseComponentExtensionContext
+		implements HTTPBindingOperationExtensions {
+
+    public HTTPBindingOperationExtensionsImpl(WSDLComponent parent, 
+            URI extNamespace, ErrorReporter errReporter) {
+        
+        super(parent, extNamespace, errReporter);
+    }
+    
+    /* ************************************************************
+     *  Methods declared by ComponentExtensionContext
+     *  
+     *  These are the abstract methods inherited from BaseComponentExtensionContext,
+     *  to be implemented by this subclass.
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperties()
+     */
+    public ExtensionProperty[] getProperties() {
+        
+        return new ExtensionProperty[] {
+                getProperty(HTTPConstants.PROP_HTTP_LOCATION),
+                getProperty(HTTPConstants.PROP_HTTP_LOCATION_IGNORE_UNCITED),
+                getProperty(HTTPConstants.PROP_HTTP_METHOD),
+                getProperty(HTTPConstants.PROP_HTTP_INPUT_SERIALIZATION),
+                getProperty(HTTPConstants.PROP_HTTP_OUTPUT_SERIALIZATION),
+                getProperty(HTTPConstants.PROP_HTTP_FAULT_SERIALIZATION),
+                getProperty(HTTPConstants.PROP_HTTP_QUERY_PARAMETER_SEPARATOR),
+                getProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING_DEFAULT)};
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperty(java.lang.String)
+     */
+    public ExtensionProperty getProperty(String propertyName) {
+        
+        if(HTTPConstants.PROP_HTTP_LOCATION.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_LOCATION, getHttpLocation());
+            
+        } else if(HTTPConstants.PROP_HTTP_LOCATION_IGNORE_UNCITED.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_LOCATION_IGNORE_UNCITED, isHttpLocationIgnoreUncited());
+            
+        } else if(HTTPConstants.PROP_HTTP_METHOD.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_METHOD, getHttpMethod());
+            
+        } else if(HTTPConstants.PROP_HTTP_INPUT_SERIALIZATION.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_INPUT_SERIALIZATION, getHttpInputSerialization());
+            
+        } else if(HTTPConstants.PROP_HTTP_OUTPUT_SERIALIZATION.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_OUTPUT_SERIALIZATION, getHttpOutputSerialization());
+            
+        } else if(HTTPConstants.PROP_HTTP_FAULT_SERIALIZATION.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_FAULT_SERIALIZATION, getHttpFaultSerialization());
+            
+        } else if(HTTPConstants.PROP_HTTP_QUERY_PARAMETER_SEPARATOR.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_QUERY_PARAMETER_SEPARATOR, 
+                    getHttpQueryParameterSeparator());
+            
+        } else if(HTTPConstants.PROP_HTTP_CONTENT_ENCODING_DEFAULT.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_CONTENT_ENCODING_DEFAULT, getHttpContentEncodingDefault());
+            
+        } else {
+            return null; //the specified property name does not exist
+        }
+        
+    }
+    
+    /* ************************************************************
+     *  Additional methods declared by HTTPBindingOperationExtensions
+     * ************************************************************/
+    
+    /*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpLocation()
+	 */
+	public HTTPLocation getHttpLocation() {
+		StringAttr httpLoc = (StringAttr) ((WSDLElement) getParent())
+				.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) getParent())
+				.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) getParent())
+				.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) getParent())
+				.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) getParent())
+				.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) getParent())
+				.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) getParent())
+				.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) getParent())
+				.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) getParent()).getParent();
+        
+        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions) binding
+                .getComponentExtensionContext(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) getParent()).getInterfaceOperation();
+        if (intOper != null) {
+            InterfaceOperationExtensions intOperExts = (InterfaceOperationExtensions) intOper
+                    .getComponentExtensionContext(WSDLExtensionConstants.NS_URI_WSDL_EXTENSIONS);
+           if (intOperExts != null && intOperExts.isSafe()) {
+              return HTTPConstants.METHOD_GET;
+           }
+        }
+        
+        // 4. default to POST.
+        return HTTPConstants.METHOD_POST;
+    }
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPEndpointExtensionsImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +1,115 @@
+/**
+ * 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.ErrorReporter;
+import org.apache.woden.wsdl20.WSDLComponent;
+import org.apache.woden.wsdl20.extensions.BaseComponentExtensionContext;
+import org.apache.woden.wsdl20.extensions.ExtensionProperty;
+import org.apache.woden.wsdl20.extensions.http.HTTPAuthenticationScheme;
+import org.apache.woden.wsdl20.extensions.http.HTTPConstants;
+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 BaseComponentExtensionContext
+		implements HTTPEndpointExtensions {
+
+    public HTTPEndpointExtensionsImpl(WSDLComponent parent, 
+            URI extNamespace, ErrorReporter errReporter) {
+        
+        super(parent, extNamespace, errReporter);
+    }
+    
+    /* ************************************************************
+     *  Methods declared by ComponentExtensionContext
+     *  
+     *  These are the abstract methods inherited from BaseComponentExtensionContext,
+     *  to be implemented by this subclass.
+     * ************************************************************/
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperties()
+     */
+    public ExtensionProperty[] getProperties() {
+        
+        return new ExtensionProperty[] {
+                getProperty(HTTPConstants.PROP_HTTP_AUTHENTICATION_SCHEME),
+                getProperty(HTTPConstants.PROP_HTTP_AUTHENTICATION_REALM)};
+    }
+
+    /*
+     * (non-Javadoc)
+     * @see org.apache.woden.wsdl20.extensions.ComponentExtensionContext#getProperty(java.lang.String)
+     */
+    public ExtensionProperty getProperty(String propertyName) {
+        
+        if(HTTPConstants.PROP_HTTP_AUTHENTICATION_SCHEME.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_AUTHENTICATION_SCHEME, getHttpAuthenticationScheme());
+            
+        } else if(HTTPConstants.PROP_HTTP_AUTHENTICATION_REALM.equals(propertyName)) {
+            return newExtensionProperty(HTTPConstants.PROP_HTTP_AUTHENTICATION_REALM, getHttpAuthenticationRealm());
+            
+        } else {
+            return null; //the specified property name does not exist
+        }
+        
+    }
+    
+    /* ************************************************************
+     *  Additional methods declared by HTTPEndpointExtensions
+     * ************************************************************/
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions#getHttpAuthenticationScheme()
+	 */
+	public HTTPAuthenticationScheme getHttpAuthenticationScheme() {
+
+		HTTPAuthenticationSchemeAttr scheme = (HTTPAuthenticationSchemeAttr) ((WSDLElement) getParent())
+				.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) getParent())
+				.getExtensionAttribute(HTTPConstants.Q_ATTR_AUTHENTICATION_REALM);
+
+		return realm != null ? realm.getString() : null;
+	}
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderDeserializer.java Tue Sep  1 05:49:02 2009
@@ -0,0 +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;
+    }
+
+}

Added: webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java?rev=809831&view=auto
==============================================================================
--- webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java (added)
+++ webservices/woden/trunk/java/woden-commons/src/main/java/org/apache/woden/internal/wsdl20/extensions/http/HTTPHeaderImpl.java Tue Sep  1 05:49:02 2009
@@ -0,0 +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);
+        } 
+    }
+    
+}



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


Mime
View raw message