Author: keith
Date: Fri Mar 28 09:27:51 2008
New Revision: 15310

Log:

Fixing broken ?wsdl functionality. Its still not a 100% cause axis2 needs a fix.



Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Fri Mar 28 09:27:51 2008
@@ -37,6 +37,7 @@
 import org.apache.axis2.description.InOutAxisOperation;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.description.WSDL2Constants;
+import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
@@ -401,42 +402,27 @@
             String interfaceName = name + WSDL2Constants.INTERFACE_PREFIX;
             axisService.addParameter(WSDL2Constants.INTERFACE_LOCAL_NAME, 
interfaceName);
 
-            AxisEndpoint soap11Endpoint = new AxisEndpoint();
-            String soap11EndpointName = name + 
WSDL2Constants.DEFAULT_SOAP11_ENDPOINT_NAME;
-            soap11Endpoint.setName(soap11EndpointName);
-            soap11Endpoint.setBinding(soap11Binding);
             soap11Binding = new AxisBinding();
             soap11Binding.setName(new QName(name + 
Java2WSDLConstants.BINDING_NAME_SUFFIX));
             soap11Binding.setType(WSDL2Constants.URI_WSDL2_SOAP);
-            soap11Binding.setParent(soap11Endpoint);
             soap11Binding
                     .setProperty(WSDL2Constants.ATTR_WSOAP_PROTOCOL, 
WSDL2Constants.HTTP_PROTOCAL);
             soap11Binding.setProperty(WSDL2Constants.ATTR_WSOAP_VERSION,
                                       
SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
             soap11Binding.setProperty(WSDL2Constants.INTERFACE_LOCAL_NAME, 
interfaceName);
 
-            AxisEndpoint soap12Endpoint = new AxisEndpoint();
-            String soap12EndpointName = name + 
WSDL2Constants.DEFAULT_SOAP12_ENDPOINT_NAME;
-            soap12Endpoint.setName(soap12EndpointName);
             soap12Binding = new AxisBinding();
-            soap12Endpoint.setBinding(soap12Binding);
             soap12Binding.setName(new QName(name + 
Java2WSDLConstants.SOAP12BINDING_NAME_SUFFIX));
             soap12Binding.setType(WSDL2Constants.URI_WSDL2_SOAP);
-            soap12Binding.setParent(soap12Endpoint);
             soap12Binding
                     .setProperty(WSDL2Constants.ATTR_WSOAP_PROTOCOL, 
WSDL2Constants.HTTP_PROTOCAL);
             soap12Binding.setProperty(WSDL2Constants.ATTR_WSOAP_VERSION,
                                       
SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
             soap12Binding.setProperty(WSDL2Constants.INTERFACE_LOCAL_NAME, 
interfaceName);
 
-            AxisEndpoint httpEndpoint = new AxisEndpoint();
-            String httpEndpointName = name + 
WSDL2Constants.DEFAULT_HTTP_ENDPOINT_NAME;
-            httpEndpoint.setName(httpEndpointName);
             httpBinding = new AxisBinding();
-            httpEndpoint.setBinding(httpBinding);
             httpBinding.setName(new QName(name + 
Java2WSDLConstants.HTTP_BINDING));
             httpBinding.setType(WSDL2Constants.URI_WSDL2_HTTP);
-            httpBinding.setParent(httpEndpoint);
             httpBinding.setProperty(WSDL2Constants.INTERFACE_LOCAL_NAME, 
interfaceName);
 
             httpLocationTable = new TreeMap(new Comparator() {
@@ -448,9 +434,56 @@
             soap11Binding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE, 
httpLocationTable);
             soap12Binding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE, 
httpLocationTable);
 
-            axisService.addEndpoint(soap11EndpointName, soap11Endpoint);
-            axisService.addEndpoint(soap12EndpointName, soap12Endpoint);
-            axisService.addEndpoint(httpEndpointName, httpEndpoint);
+            HashMap transportsIn = axisConfig.getTransportsIn();
+            Iterator iterator = transportsIn.values().iterator();
+            while (iterator.hasNext()) {
+                boolean needHttp = false;
+                String prefix = "";
+                TransportInDescription transportIn = (TransportInDescription) 
iterator.next();
+                if (transportIn.getName().equals("http")) {
+                    needHttp = true;
+                } else if (transportIn.getName().equals("https")) {
+                    needHttp = true;
+                    prefix = WSDL2Constants.DEFAULT_HTTPS_PREFIX;
+                } else if (transportIn.getName().equals("jms")) {
+                    prefix = "JMS";
+                } else if (transportIn.getName().equals("tcp")) {
+                    prefix = "TCP";
+                } else if (transportIn.getName().equals("SMTP")) {
+                    prefix = "smtp";
+                } else if (transportIn.getName().equals("XMPP")) {
+                    prefix = "XMPP";
+                }
+                AxisEndpoint soap11Endpoint = new AxisEndpoint();
+                String soap11EndpointName =
+                        prefix + WSDL2Constants.DEFAULT_SOAP11_ENDPOINT_NAME;
+                soap11Endpoint.setName(soap11EndpointName);
+                soap11Endpoint.setBinding(soap11Binding);
+                soap11Endpoint.setParent(axisService);
+                
soap11Endpoint.setTransportInDescription(transportIn.getName());
+                axisService.addEndpoint(soap11EndpointName, soap11Endpoint);
+
+                AxisEndpoint soap12Endpoint = new AxisEndpoint();
+                String soap12EndpointName =
+                        prefix + WSDL2Constants.DEFAULT_SOAP12_ENDPOINT_NAME;
+                soap12Endpoint.setName(soap12EndpointName);
+                soap12Endpoint.setBinding(soap12Binding);
+                soap12Endpoint.setParent(axisService);
+                
soap12Endpoint.setTransportInDescription(transportIn.getName());
+                axisService.addEndpoint(soap12EndpointName, soap12Endpoint);
+
+                if (needHttp) {
+                    AxisEndpoint httpEndpoint = new AxisEndpoint();
+                    String httpEndpointName =
+                            prefix + WSDL2Constants.DEFAULT_HTTP_ENDPOINT_NAME;
+                    httpEndpoint.setName(httpEndpointName);
+                    httpEndpoint.setBinding(httpBinding);
+                    httpEndpoint.setParent(axisService);
+                    
httpEndpoint.setTransportInDescription(transportIn.getName());
+                    axisService.addEndpoint(httpEndpointName, httpEndpoint);
+                }
+            }
+
 
             // Obtain the list of functions in the java script service and 
process each one of them.
             Object[] ids = engine.getIds();

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to