Author: darran.lofthouse(a)jboss.com
Date: 2008-11-20 07:46:13 -0500 (Thu, 20 Nov 2008)
New Revision: 8764
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
Log:
[JBWS-2401] Drop port from URL for endpoint where default port for the protocol is being
used.
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2008-11-19
14:30:57 UTC (rev 8763)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2008-11-20
12:46:13 UTC (rev 8764)
@@ -96,7 +96,7 @@
WSDLBinding wsdlBinding =
wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getName());
initEndpointBinding(wsdlBinding, epMetaData);
}
-
+
protected void initEndpointBinding(WSDLBinding wsdlBinding, EndpointMetaData
epMetaData)
{
String bindingType = wsdlBinding.getType();
@@ -229,11 +229,26 @@
ServerConfig config =
spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
String host = config.getWebServiceHost();
- int port = config.getWebServicePort();
+ String port = "";
if ("https".equals(uriScheme))
- port = config.getWebServiceSecurePort();
+ {
+ int portNo = config.getWebServiceSecurePort();
+ if (portNo != 443)
+ {
+ port = ":" + portNo;
+ }
- String urlStr = uriScheme + "://" + host + ":" + port +
servicePath;
+ }
+ else
+ {
+ int portNo = config.getWebServicePort();
+ if (portNo != 80)
+ {
+ port = ":" + portNo;
+ }
+ }
+
+ String urlStr = uriScheme + "://" + host + port + servicePath;
try
{
return new URL(urlStr).toExternalForm();
@@ -308,7 +323,7 @@
String serviceEndpointURL = getServiceEndpointAddress(uriScheme,
servicePath);
SPIProvider spiProvider =
SPIProviderResolver.getInstance().getProvider();
- ServerConfig config =
spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ ServerConfig config =
spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
boolean alwaysModify = config.isModifySOAPAddress();
if (alwaysModify || uriScheme == null ||
orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0)
Show replies by date