Author: klape
Date: 2013-05-27 20:12:53 -0400 (Mon, 27 May 2013)
New Revision: 17612
Modified:
thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/WSDLConstants.java
thirdparty/cxf/branches/cxf-2.2.12/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
Log:
[JBPAPP-10767] soap12:address doesn't appear in WSDL for SOAP 1.2 service
Modified:
thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/WSDLConstants.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/WSDLConstants.java 2013-05-24
09:17:15 UTC (rev 17611)
+++
thirdparty/cxf/branches/cxf-2.2.12/common/common/src/main/java/org/apache/cxf/common/WSDLConstants.java 2013-05-28
00:12:53 UTC (rev 17612)
@@ -110,8 +110,9 @@
public static final int ERORR_STYLE_USE = -1;
public static final String NS_BINDING_XML =
"http://cxf.apache.org/bindings/xformat";
+ public static final String XMLHTTP_BINDING =
"http://schemas.xmlsoap.org/wsdl/http/";
public static final QName QNAME_XMLHTTP_BINDING_ADDRESS =
- new
QName("http://schemas.xmlsoap.org/wsdl/http/",
"address");
+ new QName(XMLHTTP_BINDING, "address");
public static final String ATTR_TRANSPORT = "transport";
public static final String ATTR_LOCATION = "location";
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java 2013-05-24
09:17:15 UTC (rev 17611)
+++
thirdparty/cxf/branches/cxf-2.2.12/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java 2013-05-28
00:12:53 UTC (rev 17612)
@@ -32,9 +32,10 @@
import javax.wsdl.Port;
import javax.wsdl.extensions.http.HTTPAddress;
import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.xml.namespace.QName;
+import javax.wsdl.extensions.soap12.SOAP12Address;
import org.apache.cxf.Bus;
+import org.apache.cxf.common.WSDLConstants;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.service.Service;
@@ -50,7 +51,6 @@
import org.apache.cxf.wsdl.http.AddressType;
import org.apache.cxf.wsdl11.WSDLEndpointFactory;
-
/**
* As a ConduitInitiator, this class sets up new HTTPConduits for particular
* endpoints.
@@ -180,8 +180,15 @@
if (extensor instanceof HTTPAddress) {
final HTTPAddress httpAdd = (HTTPAddress)extensor;
- EndpointInfo info = new HttpEndpointInfo(serviceInfo,
- "http://schemas.xmlsoap.org/wsdl/http/");
+ EndpointInfo info;
+ if (httpAdd instanceof Http12AddressType) {
+ info = new HttpEndpointInfo(serviceInfo,
+ WSDLConstants.NS_SOAP12);
+ } else {
+ info = new HttpEndpointInfo(serviceInfo,
+ WSDLConstants.NS_SOAP11);
+ }
+
info.setAddress(httpAdd.getLocationURI());
info.addExtensor(httpAdd);
return info;
@@ -190,7 +197,7 @@
EndpointInfo info =
new HttpEndpointInfo(serviceInfo,
- "http://schemas.xmlsoap.org/wsdl/http/");
+ WSDLConstants.XMLHTTP_BINDING);
info.setAddress(httpAdd.getLocation());
info.addExtensor(httpAdd);
return info;
@@ -198,8 +205,14 @@
}
}
HttpEndpointInfo hei = new HttpEndpointInfo(serviceInfo,
- "http://schemas.xmlsoap.org/wsdl/http/");
- AddressType at = new HttpAddressType();
+ WSDLConstants.XMLHTTP_BINDING);
+
+ AddressType at;
+ if (WSDLConstants.NS_SOAP12_HTTP_BINDING.equals(b.getBindingId())) {
+ at = new Http12AddressType();
+ } else {
+ at = new HttpAddressType();
+ }
hei.addExtensor(at);
return hei;
@@ -289,11 +302,19 @@
}
}
+ private static class Http12AddressType extends HttpAddressType
+ implements HTTPAddress, SOAP12Address {
+ public Http12AddressType() {
+ super();
+ setElementType(WSDLConstants.QNAME_SOAP12_BINDING_ADDRESS);
+ }
+ }
+
private static class HttpAddressType extends AddressType
implements HTTPAddress, SOAPAddress {
public HttpAddressType() {
super();
- setElementType(new
QName("http://schemas.xmlsoap.org/wsdl/soap/",
"address"));
+ setElementType(WSDLConstants.QNAME_SOAP_BINDING_ADDRESS);
}
public String getLocationURI() {