Author: nadiramra
Date: Tue Feb 21 05:14:52 2012
New Revision: 1291601
URL: http://svn.apache.org/viewvc?rev=1291601&view=rev
Log:
AXIS2-4692 Java2WSDL not generating location HTTPS
Modified:
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDL.java
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL20.java
axis/axis2/java/core/trunk/src/site/xdoc/docs/reference.xml
Modified:
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDL.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDL.java?rev=1291601&r1=1291600&r2=1291601&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDL.java
(original)
+++
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDL.java
Tue Feb 21 05:14:52 2012
@@ -54,7 +54,7 @@ public class Java2WSDL {
System.out.println(" -o <output location> output
directory");
System.out.println(" -of <output file name> output
file name for the WSDL");
System.out.println(" -sn <service name> service
name");
- System.out.println(" -l <soap address> address
of the port for the WSDL");
+ System.out.println(" -l <one or more soap addresses> location
URIs, comma-delimited");
System.out.println(" -cp <class path uri> list of
classpath entries - (urls)");
System.out.println(" -tn <target namespace> target
namespace for service");
System.out.println(" -tp <target namespace prefix> target
namespace prefix for service");
@@ -73,8 +73,8 @@ public class Java2WSDL {
System.out.println(" -wv <1.1/2.0> wsdl
version - defaults to 1.1 if not specified");
System.out.println(" -dlb generate
schemas conforming to doc/lit/bare style");
System.out.println(" -dne disallow
nillable elements in the generated schema");
- System.out.println(" -disableSOAP11 disable
binding generation for SOAP11");
- System.out.println(" -disableSOAP12 disable
binding generation for SOAP12");
+ System.out.println(" -disableSOAP11 disable
binding generation for SOAP 1.1");
+ System.out.println(" -disableSOAP12 disable
binding generation for SOAP 1.2");
System.out.println(" -disableREST disable
binding generation for REST");
System.out.println(" -mpn <messagePartName> change
the part name of the generated wsdl messages");
System.out.println(" -ptn <portTypeName> port
Type name of the WSDL");
Modified:
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java?rev=1291601&r1=1291600&r2=1291601&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java
(original)
+++
axis/axis2/java/core/trunk/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java
Tue Feb 21 05:14:52 2012
@@ -340,6 +340,7 @@ public class Java2WSDLBuilder implements
AxisService2WSDL11 g = new
AxisService2WSDL11(axisService);
g.setStyle(this.style);
g.setUse(this.use);
+ g.setCheckIfEndPointActive(false);
OMElement wsdlElement = g.generateOM();
if (!isPretty()) {
wsdlElement.serialize(out);
@@ -348,6 +349,7 @@ public class Java2WSDLBuilder implements
}
} else {
AxisService2WSDL20 g = new
AxisService2WSDL20(axisService);
+ g.setCheckIfEndPointActive(false);
OMElement wsdlElement = g.generateOM();
if (!isPretty()) {
wsdlElement.serialize(out);
@@ -476,16 +478,23 @@ public class Java2WSDLBuilder implements
this.wsdlVersion = wsdlVersion;
}
- private void setServiceEPR(AxisService axisService, String urlString)
- throws Exception {
- Utils.addSoap11Endpoint(axisService, urlString);
- Utils.addSoap12Endpoint(axisService, urlString);
-
- if
("http".equals(org.apache.axis2.util.Utils.getURIScheme(urlString))) {
- Utils.addHttpEndpoint(axisService, urlString);
- }
- }
-
+ private void setServiceEPR(AxisService axisService, String urlString)
throws Exception {
+
+ // User can pass multiple location URIs, delimited by a comma.
+ String[] urls = urlString.split(",");
+
+ for (String url : urls)
+ {
+ Utils.addSoap11Endpoint(axisService, url);
+ Utils.addSoap12Endpoint(axisService, url);
+
+ if ("http".equals(org.apache.axis2.util.Utils.getURIScheme(url))
+ ||
"https".equals(org.apache.axis2.util.Utils.getURIScheme(url)))
+ {
+ Utils.addHttpEndpoint(axisService, url);
+ }
+ }
+ }
public String getCustomSchemaLocation() {
return customSchemaLocation;
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?rev=1291601&r1=1291600&r2=1291601&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
Tue Feb 21 05:14:52 2012
@@ -76,6 +76,8 @@ public class AxisService2WSDL11 implemen
private ExternalPolicySerializer serializer;
private HashMap messagesMap;
+
+ private boolean checkIfEndPointActive = true;
public AxisService2WSDL11(AxisService service) throws Exception {
this.axisService = service;
@@ -83,6 +85,18 @@ public class AxisService2WSDL11 implemen
init();
}
+ /**
+ * Sets whether to make a check if endpoint is active before adding the
endpoint
+ * to the WSDL. By default an endpoint is not added if a transport for
the endpoint
+ * is not found.
+ *
+ * @param flag true=check if endpoint is active before adding endpoint.
+ * false=add endpoint independent of whether endpoint is
active.
+ */
+ public void setCheckIfEndPointActive(boolean flag) {
+ checkIfEndPointActive = flag;
+ }
+
private void init() throws AxisFault {
/*
// the EPR list of AxisService contains REST EPRs as well.
Those REST
@@ -677,7 +691,7 @@ public class AxisService2WSDL11 implemen
/*
* Some transports might not be active at runtime.
*/
- if (!axisEndpoint.isActive()) {
+ if (checkIfEndPointActive && !axisEndpoint.isActive()) {
continue;
}
axisBinding = axisEndpoint.getBinding();
@@ -719,7 +733,7 @@ public class AxisService2WSDL11 implemen
/*
*
*/
- if (!axisEndpoint.isActive()) {
+ if (checkIfEndPointActive && !axisEndpoint.isActive()) {
continue;
}
axisBinding = axisEndpoint.getBinding();
@@ -761,7 +775,7 @@ public class AxisService2WSDL11 implemen
/*
*
*/
- if (!axisEndpoint.isActive()) {
+ if (checkIfEndPointActive && !axisEndpoint.isActive()) {
continue;
}
axisBinding = axisEndpoint.getBinding();
Modified:
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL20.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL20.java?rev=1291601&r1=1291600&r2=1291601&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL20.java
(original)
+++
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL20.java
Tue Feb 21 05:14:52 2012
@@ -79,6 +79,8 @@ public class AxisService2WSDL20 implemen
private HashMap policiesInDescription = new HashMap();
private ExternalPolicySerializer filter = null;
+ private boolean checkIfEndPointActive = true;
+
public AxisService2WSDL20(AxisService service) {
this.axisService = service;
this.serviceName = service.getName();
@@ -90,6 +92,18 @@ public class AxisService2WSDL20 implemen
}
/**
+ * Sets whether to make a check if endpoint is active before adding the
endpoint
+ * to the WSDL. By default an endpoint is not added if a transport for
the endpoint
+ * is not found.
+ *
+ * @param flag true=check if endpoint is active before adding endpoint.
+ * false=add endpoint independent of whether endpoint is
active.
+ */
+ public void setCheckIfEndPointActive(boolean flag) {
+ checkIfEndPointActive = flag;
+ }
+
+ /**
* Generates a WSDL 2.0 document for this web service
* @return The WSDL2 document element
* @throws Exception - Thrown in case an exception occurs
@@ -272,7 +286,7 @@ public class AxisService2WSDL20 implemen
/*
* Some transports might not be active at runtime.
*/
- if (!isCodegen && !axisEndpoint.isActive()) {
+ if (!isCodegen && checkIfEndPointActive &&
!axisEndpoint.isActive()) {
continue;
}
AxisBinding axisBinding = axisEndpoint.getBinding();
Modified: axis/axis2/java/core/trunk/src/site/xdoc/docs/reference.xml
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/src/site/xdoc/docs/reference.xml?rev=1291601&r1=1291600&r2=1291601&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/src/site/xdoc/docs/reference.xml (original)
+++ axis/axis2/java/core/trunk/src/site/xdoc/docs/reference.xml Tue Feb 21
05:14:52 2012
@@ -106,7 +106,7 @@ DESCRIPTION
-o <output location> output directory
-of <output file name> output file name for the
WSDL
-sn <service name> service name
- -l <soap address> address of the port for
the WSDL
+ -l <one or more soap addresses> location URIs,
comma-delimited
-cp <class path uri> list of classpath entries
- (urls)
-tn <target namespace> target namespace for
service
-tp <target namespace prefix> target namespace prefix
for service
@@ -124,6 +124,10 @@ DESCRIPTION
-xc class1 -xc class2... extra class(es) for which
schematype must be generated.
-wv <1.1/2.0> wsdl version - defaults to
1.1 if not specified
-dlb generate schemas conforming to
doc/lit/bare style
+ -dne disallow nillable elements in
the generated schema
+ -disableSOAP11 disable binding generation for
SOAP 1.1
+ -disableSOAP12 disable binding generation for
SOAP 1.2
+ -disableREST disable binding generation for
REST
EXAMPLES
Java2WSDL.sh -cn ../samples/test/searchTool.Search