From 2184b3c624b95520fd6ed4195742a2c5c4675395 Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 8 Mar 2009 12:14:40 +0000 Subject: Only create a transport description for the JMS transport if JMS is configured to be in use. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@751406 13f79535-47bb-0310-9956-ffa450edef68 --- .../tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java | 11 +++++++++++ .../tuscany/sca/binding/ws/axis2/engine/config/axis2.xml | 4 ++-- .../test/java/helloworld/HelloWorldJmsServerTestCase.java | 14 +++++++------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java index e82dd64ba5..e14213e60a 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java @@ -328,6 +328,10 @@ public class Axis2ServiceProvider { jmsSender = new JMSSender(); ListenerManager listenerManager = configContext.getListenerManager(); TransportInDescription trsIn = configContext.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_JMS); + + if (trsIn == null){ + trsIn = new TransportInDescription(Constants.TRANSPORT_JMS); + } // get JMS transport parameters from the computed URL Map jmsProps = JMSUtils.getProperties(endpointURL); @@ -482,6 +486,13 @@ public class Axis2ServiceProvider { Definition definition = wsBinding.getWSDLDocument(); QName serviceQName = wsBinding.getService().getQName(); Definition def = getDefinition(definition, serviceQName); + + // TUSCANY-2824 fix the target namespace of the definition to be the same as + // that for the port. Without this Axis fails during policy application + // when it tries to match binding operation names to port type operation + // names + //def.setTargetNamespace(port.getBinding().getPortType().getQName().getNamespaceURI()); + final WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(def, serviceQName, port.getName()); builder.setServerSide(true); diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml b/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml index ea32836f2a..f75a2e8cdb 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml @@ -201,7 +201,7 @@ - + - + diff --git a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java index 03d566cc17..df34a8cd7f 100644 --- a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java +++ b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java @@ -43,13 +43,13 @@ public class HelloWorldJmsServerTestCase{ scaDomain = SCADomain.newInstance("helloworldwsjms.composite"); } - protected void startBroker() throws Exception { - jmsBroker = new BrokerService(); - jmsBroker.setPersistent(false); - jmsBroker.setUseJmx(false); - jmsBroker.addConnector("tcp://localhost:61619"); - jmsBroker.start(); - } + protected void startBroker() throws Exception { + jmsBroker = new BrokerService(); + jmsBroker.setPersistent(false); + jmsBroker.setUseJmx(false); + jmsBroker.addConnector("tcp://localhost:61619"); + jmsBroker.start(); + } @Test public void testServiceCall() throws IOException { -- cgit v1.2.3