Author: ryman
Date: Wed May 31 13:46:49 2006
New Revision: 410664

URL: http://svn.apache.org/viewvc?rev=410664&view=rev
Log:
[WODEN-22] added support for {http location uncited ignored}

Modified:
    incubator/woden/java/ant-test/test-suite-results.zip
    
incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
    
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensions.java

Modified: incubator/woden/java/ant-test/test-suite-results.zip
URL: 
http://svn.apache.org/viewvc/incubator/woden/java/ant-test/test-suite-results.zip?rev=410664&r1=410663&r2=410664&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java?rev=410664&r1=410663&r2=410664&view=diff
==============================================================================
--- 
incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
 (original)
+++ 
incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/http/HTTPBindingOperationExtensionsImpl.java
 Wed May 31 13:46:49 2006
@@ -26,165 +26,191 @@
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingExtensions;
 import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
 import org.apache.woden.wsdl20.xml.WSDLElement;
+import org.apache.woden.xml.BooleanAttr;
 import org.apache.woden.xml.StringAttr;
 import org.apache.woden.xml.URIAttr;
 
 /**
- * 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. 
+ * 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 ([EMAIL PROTECTED])
+ * @author Arthur Ryman ([EMAIL PROTECTED], [EMAIL PROTECTED]) - added
+ *         support for {http location uncited ignored}
  */
 public class HTTPBindingOperationExtensionsImpl extends ComponentExtensionsImpl
-                                                implements 
HTTPBindingOperationExtensions 
-{
-    /* (non-Javadoc)
-     * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpLocation()
-     */
-    public URI getHttpLocation() 
-    {
-        URIAttr httpLoc = (URIAttr) ((WSDLElement)fParent)
-            .getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
-        return httpLoc != null ? httpLoc.getURI() : null;
-    }
-
-    /* (non-Javadoc)
-     * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpMethod()
-     * 
-     * 1. If whttp:method is present on the binding operation use it. 
-     * 2. Otherwise, if whttp:methodDefault is present on the binding use it. 
-     * 3. Otherwise, if the {safety} extension property of InterfaceOperation 
is 'true' return "GET".
-     * 4. Otherwise, return "POST"
-     */
-    public String getHttpMethod() 
-    {
-        String method = null;
-        
-        //1. try whttp:method
-        StringAttr methodAttr = (StringAttr) ((WSDLElement)fParent)
-            .getExtensionAttribute(HTTPConstants.Q_ATTR_METHOD);
-        if(methodAttr != null) 
-        {
-            return methodAttr.getString();
-        }
-        
-        //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}
-         * 
-         * To get here via the Woden programming model the Component model must
-         * have been initialized correctly (i.e. the Description component can 
be
-         * referenced from the Binding), so it's safe to cast the parent
-         * binding operation element to a BindingOperation component.
-         */
-        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;
-            } 
-        }
-        
-        //TODO Default POST not in spec yet, but confirmed via ws-desc posting 
30May06. Remove this todo when spec updated.
-        return HTTPConstants.METHOD_POST; 
-    }
-
-    /* (non-Javadoc)
-     * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpInputSerialization()
-     */
-    public String getHttpInputSerialization() 
-    {
-        StringAttr serialization = (StringAttr) ((WSDLElement)fParent)
-            .getExtensionAttribute(HTTPConstants.Q_ATTR_INPUT_SERIALIZATION);
-        if(serialization != null) 
-        {
-            return serialization.getString();
-        }
-        
-        String method = getHttpMethod();
-        if(method.equals(HTTPConstants.METHOD_GET) ||
-           method.equals(HTTPConstants.METHOD_DELETE))
-        {
-            return HTTPConstants.SERIAL_APP_URLENCODED;
-        }
-        else
-        {
-            //method is not GET or DELETE so it must be POST or PUT. 
-            //TODO confirm ws-desc proposal 19May06 on {http method}
-            return HTTPConstants.SERIAL_APP_XML;
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpOutputSerialization()
-     */
-    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()
-     */
-    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() 
-    {
-        // Implemented per Part 2 spec as at 25May06 but...
-        // TODO monitor ws-desc proposal 19May06 on changing the handling of 
defaults Part 2
-        
-        StringAttr separator = (StringAttr) ((WSDLElement)fParent)
-            
.getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR);
-        if(separator != null) {
-            return separator.getString();
-        }
-        
-        Binding binding = (Binding) ((BindingOperation)fParent).getParent();
-    
-        HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions)
-            
binding.getComponentExtensionsForNamespace(HTTPConstants.NS_URI_HTTP);
-        
-        //{http query parameter separator default} is a REQUIRED extension 
property
-        //so HTTPBindingExtensions must be present (i.e. no need to check for 
null).
-        return httpBindExts.getHttpQueryParameterSeparatorDefault();
-    }
-
-    /* (non-Javadoc)
-     * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpTransferCodingDefault()
-     */
-    public String getHttpTransferCodingDefault() 
-    {
-        StringAttr tfrCodingDef = (StringAttr) ((WSDLElement)fParent)
-            
.getExtensionAttribute(HTTPConstants.Q_ATTR_TRANSFER_CODING_DEFAULT);
-        return tfrCodingDef != null ? tfrCodingDef.getString() : null;
-    }
+               implements HTTPBindingOperationExtensions {
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpLocation()
+        */
+       public URI getHttpLocation() {
+               URIAttr httpLoc = (URIAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_LOCATION);
+               return httpLoc != null ? httpLoc.getURI() : null;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#isHttpLocationUncitedIgnored()
+        * 
+        * The actual value of the whttp:ignoreUncited attribute information 
item,
+        * if present. Otherwise, "false".
+        */
+       public Boolean isHttpLocationUncitedIgnored() {
+
+               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. If whttp:method is present on the binding operation use it. 2.
+        * Otherwise, if whttp:methodDefault is present on the binding use it. 
3.
+        * Otherwise, if the {safety} extension property of InterfaceOperation 
is
+        * 'true' return "GET". 4. Otherwise, return "POST"
+        */
+       public String getHttpMethod() {
+               String method = null;
+
+               // 1. try whttp:method
+               StringAttr methodAttr = (StringAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_METHOD);
+               if (methodAttr != null) {
+                       return methodAttr.getString();
+               }
+
+               // 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}
+                * 
+                * To get here via the Woden programming model the Component 
model must
+                * have been initialized correctly (i.e. the Description 
component can
+                * be referenced from the Binding), so it's safe to cast the 
parent
+                * binding operation element to a BindingOperation component.
+                */
+               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;
+                       }
+               }
+
+               // TODO Default POST not in spec yet, but confirmed via ws-desc 
posting
+               // 30May06. Remove this todo when spec updated.
+               return HTTPConstants.METHOD_POST;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpInputSerialization()
+        */
+       public String getHttpInputSerialization() {
+               StringAttr serialization = (StringAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_INPUT_SERIALIZATION);
+               if (serialization != null) {
+                       return serialization.getString();
+               }
+
+               String method = getHttpMethod();
+               if (method.equals(HTTPConstants.METHOD_GET)
+                               || method.equals(HTTPConstants.METHOD_DELETE)) {
+                       return HTTPConstants.SERIAL_APP_URLENCODED;
+               } else {
+                       // method is not GET or DELETE so it must be POST or 
PUT.
+                       // TODO confirm ws-desc proposal 19May06 on {http 
method}
+                       return HTTPConstants.SERIAL_APP_XML;
+               }
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpOutputSerialization()
+        */
+       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()
+        */
+       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() {
+               // Implemented per Part 2 spec as at 25May06 but...
+               // TODO monitor ws-desc proposal 19May06 on changing the 
handling of
+               // defaults Part 2
+
+               StringAttr separator = (StringAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_QUERY_PARAMETER_SEPARATOR);
+               if (separator != null) {
+                       return separator.getString();
+               }
+
+               Binding binding = (Binding) ((BindingOperation) 
fParent).getParent();
+
+               HTTPBindingExtensions httpBindExts = (HTTPBindingExtensions) 
binding
+                               
.getComponentExtensionsForNamespace(HTTPConstants.NS_URI_HTTP);
+
+               // {http query parameter separator default} is a REQUIRED 
extension
+               // property
+               // so HTTPBindingExtensions must be present (i.e. no need to 
check for
+               // null).
+               return httpBindExts.getHttpQueryParameterSeparatorDefault();
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see 
org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions#getHttpTransferCodingDefault()
+        */
+       public String getHttpTransferCodingDefault() {
+               StringAttr tfrCodingDef = (StringAttr) ((WSDLElement) fParent)
+                               
.getExtensionAttribute(HTTPConstants.Q_ATTR_TRANSFER_CODING_DEFAULT);
+               return tfrCodingDef != null ? tfrCodingDef.getString() : null;
+       }
 
 }

Modified: 
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensions.java
URL: 
http://svn.apache.org/viewvc/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensions.java?rev=410664&r1=410663&r2=410664&view=diff
==============================================================================
--- 
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensions.java
 (original)
+++ 
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/http/HTTPBindingOperationExtensions.java
 Wed May 31 13:46:49 2006
@@ -27,6 +27,7 @@
  * These include:
  * <ul>
  * <li>{http location}</li>
+ * <li>{http location uncited ignored}</li>
  * <li>{http method}</li>
  * <li>{http input serialization}</li>
  * <li>{http output serialization}</li>
@@ -36,6 +37,8 @@
  * </ul> 
  * 
  * @author John Kaputin ([EMAIL PROTECTED])
+ * @author Arthur Ryman ([EMAIL PROTECTED], [EMAIL PROTECTED])
+ * - added support for {http location uncited ignored}
  */
 public interface HTTPBindingOperationExtensions extends ComponentExtensions 
 {
@@ -43,6 +46,11 @@
      * @return URI the {http location} property, represented by the 
whttp:location extension attribute
      */
     public URI getHttpLocation();
+    
+    /**
+     * @return Boolean the {http location uncited ignored} property, 
represented by the whttp:ignoreUncited extension attribute
+     */
+    public Boolean isHttpLocationUncitedIgnored();
     
     /**
      * @return String the {http method} property, represented by the 
whttp:method extension attribute



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to