Author: keith
Date: Fri May 2 03:30:56 2008
New Revision: 16477
Log:
Fixing the stub genarator as it was not working correctly after the axis2
binding hierarchy change
Modified:
trunk/mashup/java/modules/coreservices/JSStubGeneratorService/src/org/wso2/mashup/JSStubGenerator.java
Modified:
trunk/mashup/java/modules/coreservices/JSStubGeneratorService/src/org/wso2/mashup/JSStubGenerator.java
==============================================================================
---
trunk/mashup/java/modules/coreservices/JSStubGeneratorService/src/org/wso2/mashup/JSStubGenerator.java
(original)
+++
trunk/mashup/java/modules/coreservices/JSStubGeneratorService/src/org/wso2/mashup/JSStubGenerator.java
Fri May 2 03:30:56 2008
@@ -18,7 +18,13 @@
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.*;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisEndpoint;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder;
+import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
+import org.apache.axis2.description.WSDL2Constants;
import org.apache.axis2.namespace.Constants;
import org.apache.axis2.util.XMLUtils;
import org.apache.axis2.util.XSLTTemplateProcessor;
@@ -28,7 +34,11 @@
import javax.activation.DataHandler;
import javax.xml.stream.XMLStreamException;
-import javax.xml.transform.*;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.ByteArrayInputStream;
@@ -130,6 +140,16 @@
i++;
}
service.setEPRs(eprs);
+
+ // With the change to the deployment mechanism in axis2
now it checks weather a
+ // transport is active before displaying it in the WSDL.
This check needs access
+ // to the AxisConfiguration, and it it is null it returns
false. Hence we have
+ // to put in a hck here to get the conversion to work
correctly.
+ MessageContext messageContext =
MessageContext.getCurrentMessageContext();
+ AxisServiceGroup axisServiceGroup = new AxisServiceGroup();
+ axisServiceGroup.setParent(
+
messageContext.getConfigurationContext().getAxisConfiguration());
+ service.setParent(axisServiceGroup);
ByteArrayOutputStream outputStream = new
ByteArrayOutputStream();
service.printWSDL2(outputStream);
wsdlStream = new
ByteArrayInputStream(outputStream.toByteArray());
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev