axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r479611 - in /webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description: AxisEndpoint.java WSDL20ToAxisServiceBuilder.java WSDL2Constants.java
Date Mon, 27 Nov 2006 13:09:11 GMT
Author: keithc
Date: Mon Nov 27 05:09:08 2006
New Revision: 479611

URL: http://svn.apache.org/viewvc?view=rev&rev=479611
Log:
Added HTTPBinding specific attributes to relavant classes

Modified:
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java?view=diff&rev=479611&r1=479610&r2=479611
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java
(original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/AxisEndpoint.java
Mon Nov 27 05:09:08 2006
@@ -22,6 +22,8 @@
 import org.apache.axis2.AxisFault;
 
 import javax.xml.namespace.QName;
+import java.util.Map;
+import java.util.HashMap;
 
 public class AxisEndpoint extends AxisDescription{
 
@@ -33,6 +35,29 @@
 
     // The alias used for the endpoint
     private String alias;
+
+    private Map options;
+
+    public AxisEndpoint() {
+            options = new HashMap();
+    }
+
+    public void setProperty(String name, Object value) {
+        options.put(name, value);
+    }
+
+    /**
+     * @param name name of the property to search for
+     * @return the value of the property, or null if the property is not found
+     */
+    public Object getProperty(String name) {
+        Object obj = options.get(name);
+        if (obj != null) {
+            return obj;
+        }
+
+        return null;
+    }
 
     public String getAlias() {
         return alias;

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=479611&r1=479610&r2=479611
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
(original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
Mon Nov 27 05:09:08 2006
@@ -9,6 +9,7 @@
 import org.apache.woden.*;
 import org.apache.woden.internal.DOMWSDLFactory;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingExtensionsImpl;
+import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingExtensionsImpl;
 import org.apache.woden.schema.Schema;
 import org.apache.woden.types.NCName;
 import org.apache.woden.wsdl20.*;
@@ -16,6 +17,10 @@
 import org.apache.woden.wsdl20.enumeration.MessageLabel;
 import org.apache.woden.wsdl20.extensions.ExtensionElement;
 import org.apache.woden.wsdl20.extensions.UnknownExtensionElement;
+import org.apache.woden.wsdl20.extensions.http.HTTPEndpointExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingFaultExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingOperationExtensions;
+import org.apache.woden.wsdl20.extensions.http.HTTPBindingMessageReferenceExtensions;
 import org.apache.woden.wsdl20.extensions.soap.*;
 import org.apache.woden.wsdl20.xml.*;
 import org.apache.ws.commons.schema.XmlSchema;
@@ -225,6 +230,16 @@
             axisEndpoint.setBinding(processBinding(endpoint.getBinding()));
         }
 
+        HTTPEndpointExtensions httpEndpointExtensions = null;
+        try {
+            httpEndpointExtensions = (HTTPEndpointExtensions)endpoint.getComponentExtensionsForNamespace(new
URI(WSDL2Constants.URI_WSDL2_HTTP));
+        } catch (URISyntaxException e) {
+            throw new AxisFault("HTTP Binding Extention not found");
+        }
+
+        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,httpEndpointExtensions.getHttpAuthenticationScheme());
+        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,httpEndpointExtensions.getHttpAuthenticationRealm());
+
         return axisEndpoint;
 
     }
@@ -303,10 +318,12 @@
 
         axisBinding.setName(binding.getName());
 
-        if (binding.getType().toString().equals(WSDL2Constants.URI_WSDL2_SOAP)) {
-            processSoapBindingExtention(binding, axisBinding);
-        } else {
-            //ToDo implement other bindings
+        String bindingType = binding.getType().toString();
+
+        if (bindingType.equals(WSDL2Constants.URI_WSDL2_SOAP)) {
+            processSOAPBindingExtention(binding, axisBinding);
+        } else if (bindingType.equals(WSDL2Constants.URI_WSDL2_HTTP)) {
+            processHTTPBindingExtention(binding, axisBinding);
         }
 
         // We should process the interface based on the service not on a binding
@@ -327,7 +344,7 @@
         return axisBinding;
     }
 
-    private void processSoapBindingExtention(Binding binding, AxisBinding axisBinding)
+    private void processSOAPBindingExtention(Binding binding, AxisBinding axisBinding)
             throws AxisFault {
 
         // Capture all the binding specific properties
@@ -539,6 +556,144 @@
                         soapBindingFaultReferenceExtensions.getSoapModules());
 
                 axisBindingOperation.addFault(axisBindingMessageFault);
+
+            }
+
+            axisBinding.addChild(axisBindingOperation.getName(),axisBindingOperation);
+
+
+        }
+    }
+
+    private void processHTTPBindingExtention(Binding binding, AxisBinding axisBinding)
+            throws AxisFault {
+
+        // Capture all the binding specific properties
+
+        HTTPBindingExtensionsImpl httpBindingExtensions = null;
+        try {
+            httpBindingExtensions = (HTTPBindingExtensionsImpl) binding
+                    .getComponentExtensionsForNamespace(new URI(WSDL2Constants.URI_WSDL2_HTTP));
+        } catch (URISyntaxException e) {
+            throw new AxisFault("HTTP Binding Extention not found");
+        }
+
+        axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD,httpBindingExtensions.getHttpMethodDefault());
+        axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,httpBindingExtensions.getHttpQueryParameterSeparatorDefault());
+        axisBinding.setProperty(WSDL2Constants.ATTR_WHTTP_TRANSFER_CODING,httpBindingExtensions.getHttpTransferCodingDefault());
+
+        // Capture all the fault specific properties
+
+        BindingFault[] bindingFaults = binding.getBindingFaults();
+        for (int i = 0; i < bindingFaults.length; i++) {
+            BindingFault bindingFault = bindingFaults[i];
+            InterfaceFault interfaceFault = bindingFault.getInterfaceFault();
+
+            AxisBindingMessage axisBindingFault = new AxisBindingMessage();
+            axisBindingFault.setName(interfaceFault.getName().getLocalPart());
+            axisBindingFault.setParent(axisBinding);
+
+            HTTPBindingFaultExtensions httpBindingFaultExtensions = null;
+
+            try {
+                httpBindingFaultExtensions = (HTTPBindingFaultExtensions) bindingFault
+                        .getComponentExtensionsForNamespace(new URI(WSDL2Constants.URI_WSDL2_HTTP));
+            } catch (URISyntaxException e) {
+                throw new AxisFault("HTTP Binding Extention not found");
+            }
+
+            axisBindingFault.setProperty(WSDL2Constants.ATTR_WHTTP_CODE,
+                    httpBindingFaultExtensions.getHttpErrorStatusCode());
+            axisBindingFault.setProperty(WSDL2Constants.ATTR_WHTTP_HEADER,
+                    httpBindingFaultExtensions.getHttpHeaders());
+            axisBindingFault.setProperty(WSDL2Constants.ATTR_WHTTP_TRANSFER_CODING,
+                    httpBindingFaultExtensions.getHttpTransferCoding());
+
+            axisBinding.addFault(axisBindingFault);
+
+        }
+
+        // Capture all the binding operation specific properties
+
+        BindingOperation[] bindingOperations = binding.getBindingOperations();
+        for (int i = 0; i < bindingOperations.length; i++) {
+            BindingOperation bindingOperation = bindingOperations[i];
+
+            AxisBindingOperation axisBindingOperation = new AxisBindingOperation();
+            AxisOperation axisOperation =
+                    axisService.getOperation(bindingOperation.getInterfaceOperation().getName());
+
+            axisBindingOperation.setAxisOperation(axisOperation);
+            axisBindingOperation.setParent(axisBinding);
+            axisBindingOperation.setName(axisOperation.getName());
+
+            HTTPBindingOperationExtensions httpBindingOperationExtensions = null;
+            try {
+                httpBindingOperationExtensions = ((HTTPBindingOperationExtensions)
+                        bindingOperation.getComponentExtensionsForNamespace(
+                                new URI(WSDL2Constants.URI_WSDL2_HTTP)));
+            } catch (URISyntaxException e) {
+                throw new AxisFault("HTTP Binding Extention not found");
+            }
+
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_FAULT_SERIALIZATION,httpBindingOperationExtensions.getHttpFaultSerialization());
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,httpBindingOperationExtensions.getHttpInputSerialization());
+            URI httpLocation = httpBindingOperationExtensions.getHttpLocation();
+            if (httpLocation != null) {
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION,httpLocation);
+            }
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD,httpBindingOperationExtensions.getHttpMethod());
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION,httpBindingOperationExtensions.getHttpOutputSerialization());
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,httpBindingOperationExtensions.getHttpQueryParameterSeparator());
+            axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_TRANSFER_CODING,httpBindingOperationExtensions.getHttpTransferCodingDefault());
+
+            BindingMessageReference[] bindingMessageReferences =
+                    bindingOperation.getBindingMessageReferences();
+            for (int j = 0; j < bindingMessageReferences.length; j++) {
+                BindingMessageReference bindingMessageReference = bindingMessageReferences[j];
+
+                AxisBindingMessage axisBindingMessage = new AxisBindingMessage();
+                axisBindingMessage.setParent(axisBindingOperation);
+
+                AxisMessage axisMessage = axisOperation.getMessage(bindingMessageReference
+                        .getInterfaceMessageReference().getMessageLabel().toString());
+
+                axisBindingMessage.setAxisMessage(axisMessage);
+                axisBindingMessage.setName(axisMessage.getName());
+                axisBindingMessage.setDirection(axisMessage.getDirection());
+
+
+                HTTPBindingMessageReferenceExtensions httpBindingMessageReferenceExtensions
= null;
+                try {
+                    httpBindingMessageReferenceExtensions =
+                            (HTTPBindingMessageReferenceExtensions) bindingMessageReference
+                                    .getComponentExtensionsForNamespace(
+                                            new URI(WSDL2Constants.URI_WSDL2_HTTP));
+                } catch (URISyntaxException e) {
+                    throw new AxisFault("HTTP Binding Extention not found");
+                }
+
+                axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_HEADER,httpBindingMessageReferenceExtensions.getHttpHeaders());
+                axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_TRANSFER_CODING,httpBindingMessageReferenceExtensions.getHttpTransferCoding());
+
+
+//                    SOAPHeaderBlock[] soapHeaders = soapHeaderExt.getSoapHeaders();
+//
+//                        for (int k = 0; k < soapHeaders.length; k++) {
+//                            SOAPHeaderBlock soapHeader = soapHeaders[j];
+//
+//                            ElementDeclaration elementDeclaration = soapHeader.getElementDeclaration();
+//
+//                            if (elementDeclaration != null) {
+//                                QName name = elementDeclaration.getName();
+//                                SOAPHeaderMessage soapHeaderMessage = new SOAPHeaderMessage(name);
+//                                soapHeaderMessage.setRequired(soapHeader.isRequired().booleanValue());
+//                                message.addSoapHeader(soapHeaderMessage);
+//                            }
+//                        }
+
+                axisBindingOperation.addChild(axisBindingMessage.getName(),axisBindingMessage);
+
 
             }
 

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java?view=diff&rev=479611&r1=479610&r2=479611
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java
(original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL2Constants.java
Mon Nov 27 05:09:08 2006
@@ -23,6 +23,7 @@
     String DEFAULT_WSDL_NAMESPACE_PREFIX = "wsdl2";
     String DESCRIPTION = "description";
     String URI_WSDL2_SOAP = "http://www.w3.org/2006/01/wsdl/soap";
+    String URI_WSDL2_HTTP = "http://www.w3.org/2006/01/wsdl/http";
     String SOAP_PREFIX = "wsoap";
     String URI_WSDL2_SOAP_ENV = "http://www.w3.org/2003/05/soap-envelope";
     String SOAP_ENV_PREFIX = "soap";
@@ -62,6 +63,14 @@
     String ATTR_WHTTP_TRANSFER_CODING = "whttp:transferCoding";
     String ATTR_WHTTP_LOCATION = "whttp:location";
     String ATTR_WHTTP_HEADER = "whttp:header";
+    String ATTR_WHTTP_METHOD = "whttp:method";
+    String ATTR_WHTTP_CODE = "whttp:code";
+    String ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR = "whttp:queryParameterSeparator";
+    String ATTR_WHTTP_INPUT_SERIALIZATION = "whttp:inputSerialization";
+    String ATTR_WHTTP_OUTPUT_SERIALIZATION = "whttp:outputSerialization";
+    String ATTR_WHTTP_FAULT_SERIALIZATION = "whttp:faultSerialization";
+    String ATTR_WHTTP_AUTHENTICATION_TYPE = "whttp:authenticationType";
+    String ATTR_WHTTP_AUTHENTICATION_REALM = "whttp:authenticationRealm";
 
     String SOAP_VERSION_1_1 = "1.1";
     String SOAP_VERSION_1_2 = "1.2";



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


Mime
View raw message