Author: keith
Date: Tue Mar 11 21:59:16 2008
New Revision: 14721
Log:
Fixing Mashup-620
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
Tue Mar 11 21:59:16 2008
@@ -18,10 +18,7 @@
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDL2Constants;
+import org.apache.axis2.description.*;
import org.apache.axis2.namespace.Constants;
import org.apache.axis2.util.XMLUtils;
import org.apache.axis2.util.XSLTTemplateProcessor;
@@ -31,11 +28,7 @@
import javax.activation.DataHandler;
import javax.xml.stream.XMLStreamException;
-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.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.ByteArrayInputStream;
@@ -44,6 +37,8 @@
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
+import java.util.Iterator;
+import java.util.Map;
/**
* This service facilitates the genaratin of JavaScript stubs given a WSDL
document or url to a WSDL.
@@ -125,6 +120,16 @@
.setDocumentBaseUri(uri);
wsdl11ToAxisServiceBuilder.setAllPorts(true);
AxisService service =
wsdl11ToAxisServiceBuilder.populateService();
+ Map endpointsMap = service.getEndpoints();
+ Iterator iterator = endpointsMap.values().iterator();
+ String[] eprs = new String[endpointsMap.size()];
+ int i=0;
+ while (iterator.hasNext()) {
+ AxisEndpoint axisEndpoint = (AxisEndpoint)
iterator.next();
+ eprs[i] = axisEndpoint.getEndpointURL();
+ i++;
+ }
+ service.setEPRs(eprs);
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