summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-14 00:50:38 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-14 00:50:38 +0000
commitb4f48f407a8fefba16395eceb34de6bd48e74d12 (patch)
tree7e1bcf4456ef1dfd3b4d337ed7ea262f1259ffef /sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src
parent014971ccb5b2041147cf9d84d498cce64ea0493e (diff)
Improve the IP address binding to be based on the host from the uri
Having servlet host to return deployed uri git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@922701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src')
-rw-r--r--sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
index 589d3881c0..ec6c610d76 100644
--- a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
+++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
@@ -67,6 +67,7 @@ public class Axis2ServiceBindingProvider extends Axis2BaseBindingProvider implem
private WebServiceBinding wsBinding;
private Port wsdlPort;
private String endpointURI;
+ private String deployedURI;
private InterfaceContract contract;
// The Axis2 configuration that the binding creates
@@ -140,15 +141,16 @@ public class Axis2ServiceBindingProvider extends Axis2BaseBindingProvider implem
endpointURI = Axis2EngineIntegration.getPortAddress(wsdlPort);
if (endpointURI.startsWith("jms:")) {
+ deployedURI = endpointURI;
isJMSRequired = true;
} else {
if (servletHost == null) {
throw new ServiceRuntimeException("No Servlet host is avaible for HTTP web services");
}
- endpointURI = servletHost.getURLMapping(endpointURI, httpSecurityContext).toString();
+ deployedURI = servletHost.getURLMapping(endpointURI, httpSecurityContext).toString();
}
- Axis2EngineIntegration.setPortAddress(wsdlPort, endpointURI);
+ Axis2EngineIntegration.setPortAddress(wsdlPort, deployedURI);
// Apply the configuration from the mayProvides intents
@@ -163,28 +165,28 @@ public class Axis2ServiceBindingProvider extends Axis2BaseBindingProvider implem
if (isJMSRequired){
// TODO - do we need to go back to configurator?
}
- wsBinding.setURI(endpointURI);
+ wsBinding.setURI(deployedURI);
}
private static final String DEFAULT_QUEUE_CONNECTION_FACTORY = "TuscanyQueueConnectionFactory";
public void start() {
try {
- createAxisService(endpointURI, wsdlPort);
+ createAxisService(deployedURI, wsdlPort);
- if (endpointURI.startsWith("http://") ||
- endpointURI.startsWith("https://") ||
- endpointURI.startsWith("/")) {
+ if (deployedURI.startsWith("http://") ||
+ deployedURI.startsWith("https://") ||
+ deployedURI.startsWith("/")) {
Axis2ServiceServlet servlet = new Axis2ServiceServlet();
servlet.init(configContext);
if (httpSecurityContext.isSSLEnabled()){
- servletHost.addServletMapping(endpointURI, servlet, httpSecurityContext);
+ deployedURI = servletHost.addServletMapping(endpointURI, servlet, httpSecurityContext);
} else {
- servletHost.addServletMapping(endpointURI, servlet);
+ deployedURI = servletHost.addServletMapping(endpointURI, servlet);
}
- } else if (endpointURI.startsWith("jms")) {
- logger.log(Level.INFO, "Axis2 JMS URL=" + endpointURI);
+ } else if (deployedURI.startsWith("jms")) {
+ logger.log(Level.INFO, "Axis2 JMS URL=" + deployedURI);
jmsListener = new JMSListener();
jmsSender = new JMSSender();
@@ -249,7 +251,7 @@ public class Axis2ServiceBindingProvider extends Axis2BaseBindingProvider implem
// get the path to the service
// [nash] Need a leading slash for WSDL imports to work with ?wsdl
- URI uriPath = new URI(endpointURI);
+ URI uriPath = new URI(deployedURI);
String stringURIPath = uriPath.getPath();
configContext.getAxisConfiguration().removeService(stringURIPath);
} catch (URISyntaxException e) {