Author: isurues Date: Sat Feb 5 06:49:45 2011 New Revision: 1067399 URL: http://svn.apache.org/viewvc?rev=1067399&view=rev Log: Fixing https://issues.apache.org/jira/browse/AXIS2-2477 and fixing the test cases which are affected by the service name fix
Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImplNoSEI.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDefaultService.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisable2Service.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisableService.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMEnableService.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMThresholdService.java axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/PortDeserializationTests.java axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImplNoSEI.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImplNoSEI.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImplNoSEI.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/EchoImplNoSEI.java Sat Feb 5 06:49:45 2011 @@ -24,7 +24,7 @@ import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; -@WebService(name = "EchoNoSEI", serviceName="RPCLitStringArrayService", targetNamespace = "http://sei.stringarray.rpclit.jaxws.axis2.apache.org") +@WebService(name = "EchoNoSEI", serviceName="RPCLitStringArrayEchoNoSEIService", targetNamespace = "http://sei.stringarray.rpclit.jaxws.axis2.apache.org") @SOAPBinding(style = Style.RPC) public class EchoImplNoSEI { Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/rpclit/stringarray/tests/RPCLitStringArrayTests.java Sat Feb 5 06:49:45 2011 @@ -77,7 +77,7 @@ public class RPCLitStringArrayTests exte Echo portType = service.getEchoPort(); BindingProvider p = (BindingProvider) portType; p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, - "http://localhost:6060/axis2/services/RPCLitStringArrayService.EchoNoSEIPort"); + "http://localhost:6060/axis2/services/RPCLitStringArrayEchoNoSEIService.EchoNoSEIPort"); String[] strArray= {"str1", "str2", "str3", "str4 5"}; StringArray array = new StringArray(); Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/MtomSampleTests.java Sat Feb 5 06:49:45 2011 @@ -60,15 +60,15 @@ public class MtomSampleTests extends Abs private static final String URL_ENDPOINT = "http://localhost:6060/axis2/services/MtomSampleService.MtomSampleServicePort"; private static final String URL_ENDPOINT_MTOMDISABLE = - "http://localhost:6060/axis2/services/MtomSampleService.MtomSampleMTOMDisableServicePort"; + "http://localhost:6060/axis2/services/MtomSampleMTOMDisableService.MtomSampleMTOMDisableServicePort"; private static final String URL_ENDPOINT_MTOMDISABLE2 = - "http://localhost:6060/axis2/services/MtomSampleService.MtomSampleMTOMDisable2ServicePort"; + "http://localhost:6060/axis2/services/MtomSampleMTOMDisable2Service.MtomSampleMTOMDisable2ServicePort"; private static final String URL_ENDPOINT_MTOMENABLE = - "http://localhost:6060/axis2/services/MtomSampleService.MtomSampleMTOMEnableServicePort"; + "http://localhost:6060/axis2/services/MtomSampleMTOMEnableService.MtomSampleMTOMEnableServicePort"; private static final String URL_ENDPOINT_MTOMDEFAULT = - "http://localhost:6060/axis2/services/MtomSampleService.MtomSampleMTOMDefaultServicePort"; + "http://localhost:6060/axis2/services/MtomSampleMTOMDefaultService.MtomSampleMTOMDefaultServicePort"; private static final String URL_ENDPOINT_MTOMTHRESHOLD = - "http://localhost:6060/axis2/services/MtomSampleService.MtomSampleMTOMThresholdServicePort"; + "http://localhost:6060/axis2/services/MtomSampleMTOMThresholdService.MtomSampleMTOMThresholdServicePort"; private static final String IMAGE_DIR = System.getProperty("basedir",".")+"/"+"test-resources"+File.separator+"image"; Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDefaultService.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDefaultService.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDefaultService.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDefaultService.java Sat Feb 5 06:49:45 2011 @@ -41,7 +41,7 @@ import java.io.InputStream; /** * Endpoint with default MTOM annotation */ -@WebService(serviceName="MtomSampleService", +@WebService(serviceName="MtomSampleMTOMDefaultService", endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample") //@BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING) @MTOM Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisable2Service.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisable2Service.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisable2Service.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisable2Service.java Sat Feb 5 06:49:45 2011 @@ -42,7 +42,7 @@ import java.io.InputStream; * The binding indicates MTOM, but @MTOM indicates enabled=false * Thus no MTOM. */ -@WebService(serviceName="MtomSampleService", +@WebService(serviceName="MtomSampleMTOMDisable2Service", endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample") @BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING) @MTOM(enabled=false) Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisableService.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisableService.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisableService.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMDisableService.java Sat Feb 5 06:49:45 2011 @@ -42,7 +42,7 @@ import java.io.InputStream; /** * Endpoint with MTOM disabled */ -@WebService(serviceName="MtomSampleService", +@WebService(serviceName="MtomSampleMTOMDisableService", endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample") //@BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING) @MTOM(enabled=false) Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMEnableService.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMEnableService.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMEnableService.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMEnableService.java Sat Feb 5 06:49:45 2011 @@ -41,7 +41,7 @@ import java.io.InputStream; /** * Endpoint with MTOM enabled */ -@WebService(serviceName="MtomSampleService", +@WebService(serviceName="MtomSampleMTOMEnableService", endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample") //@BindingType(SOAPBinding.SOAP11HTTP_MTOM_BINDING) @MTOM(enabled=true) Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMThresholdService.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMThresholdService.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMThresholdService.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/mtom/MtomSampleMTOMThresholdService.java Sat Feb 5 06:49:45 2011 @@ -37,7 +37,7 @@ import org.test.mtom.ObjectFactory; * Endpoint with MTOM enabled and Threshold set to size bigger than the attachment size. * The response from Server should have attachments inlined. */ -@WebService(serviceName="MtomSampleService", +@WebService(serviceName="MtomSampleMTOMThresholdService", endpointInterface="org.apache.axis2.jaxws.sample.mtom.MtomSample") @MTOM(enabled=true, threshold=99000) public class MtomSampleMTOMThresholdService implements MtomSample { Modified: axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/PortDeserializationTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/PortDeserializationTests.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/PortDeserializationTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/client/PortDeserializationTests.java Sat Feb 5 06:49:45 2011 @@ -78,7 +78,7 @@ public class PortDeserializationTests ex EndpointDescription endpointDesc = bindingProvider.getEndpointDescription(); AxisService axisService = endpointDesc.getAxisService(); assertNotNull(axisService); - assertEquals(svc1QN.getLocalPart()+ "." + portQN.getLocalPart(), axisService.getName()); + assertEquals(svc1QN.getLocalPart(), axisService.getName()); // Now that the AxisService is setup, create an Axis2 message context, set the // AxisService on it. Serialize it out then read it back in. @@ -150,7 +150,7 @@ public class PortDeserializationTests ex EndpointDescription endpointDesc1 = bindingProvider1.getEndpointDescription(); AxisService axisService1 = endpointDesc1.getAxisService(); assertNotNull(axisService1); - assertEquals(svc1QN.getLocalPart()+ "." + portQN.getLocalPart(), axisService1.getName()); + assertEquals(svc1QN.getLocalPart(), axisService1.getName()); org.apache.axis2.jaxws.spi.BindingProvider bindingProvider2 = (org.apache.axis2.jaxws.spi.BindingProvider) port2; @@ -159,10 +159,10 @@ public class PortDeserializationTests ex assertNotNull(axisService2); assertNotSame(axisService1, axisService2); // The 2nd AxisService created gets a unique ID appended to the name - String baseName = svc2QN.getLocalPart()+ "." + portQN.getLocalPart(); + String baseName = svc2QN.getLocalPart(); assertFalse(baseName.equals(axisService2.getName())); assertTrue(axisService2.getName().startsWith(baseName)); - + // Now that the AxisService is setup, create two Axis2 message contexts, set the // AxisServices on them. Serialize them out MessageContext msgCtx1 = new MessageContext(); @@ -253,7 +253,7 @@ public class PortDeserializationTests ex EndpointDescription endpointDesc1 = bindingProvider1.getEndpointDescription(); AxisService axisService1 = endpointDesc1.getAxisService(); assertNotNull(axisService1); - assertEquals(svc1QN.getLocalPart()+ "." + portQN.getLocalPart(), axisService1.getName()); + assertEquals(svc1QN.getLocalPart(), axisService1.getName()); org.apache.axis2.jaxws.spi.BindingProvider bindingProvider2 = (org.apache.axis2.jaxws.spi.BindingProvider) port2; @@ -262,7 +262,7 @@ public class PortDeserializationTests ex assertNotNull(axisService2); assertNotSame(axisService1, axisService2); // The 2nd AxisService created gets a unique ID appended to the name - String baseName = svc2QN.getLocalPart()+ "." + portQN.getLocalPart(); + String baseName = svc2QN.getLocalPart(); assertFalse(baseName.equals(axisService2.getName())); assertTrue(axisService2.getName().startsWith(baseName)); @@ -353,7 +353,7 @@ public class PortDeserializationTests ex EndpointDescription endpointDesc1 = bindingProvider1.getEndpointDescription(); AxisService axisService1 = endpointDesc1.getAxisService(); assertNotNull(axisService1); - assertEquals(svc1QN.getLocalPart()+ "." + portQN.getLocalPart(), axisService1.getName()); + assertEquals(svc1QN.getLocalPart(), axisService1.getName()); org.apache.axis2.jaxws.spi.BindingProvider bindingProvider2 = (org.apache.axis2.jaxws.spi.BindingProvider) port2; @@ -362,7 +362,7 @@ public class PortDeserializationTests ex assertNotNull(axisService2); assertNotSame(axisService1, axisService2); // The 2nd AxisService created gets a unique ID appended to the name - String baseName = svc2QN.getLocalPart()+ "." + portQN.getLocalPart(); + String baseName = svc2QN.getLocalPart(); assertFalse(baseName.equals(axisService2.getName())); assertTrue(axisService2.getName().startsWith(baseName)); Modified: axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original) +++ axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Sat Feb 5 06:49:45 2011 @@ -1201,6 +1201,19 @@ public class Utils { axisService.setEndpointName(soap11EndpointName); } + public static void addSoap11Endpoint(AxisService axisService, String protocol, + String endpointName) throws Exception { + AxisEndpoint httpSoap11Endpoint = new AxisEndpoint(); + httpSoap11Endpoint.setName(endpointName); + httpSoap11Endpoint.setParent(axisService); + httpSoap11Endpoint.setTransportInDescription(protocol); + + populateSoap11Endpoint(axisService, httpSoap11Endpoint, null); + axisService.addEndpoint(httpSoap11Endpoint.getName(), httpSoap11Endpoint); + // setting soap11 endpoint as the default endpoint + axisService.setEndpointName(endpointName); + } + public static void addSoap12Endpoint(AxisService axisService, String url) throws Exception { String protocol = org.apache.axis2.util.Utils.getURIScheme(url); @@ -1217,6 +1230,17 @@ public class Utils { httpSoap12Endpoint); } + public static void addSoap12Endpoint(AxisService axisService, String protocol, + String endpointName) throws Exception { + AxisEndpoint httpSoap12Endpoint = new AxisEndpoint(); + httpSoap12Endpoint.setName(endpointName); + httpSoap12Endpoint.setParent(axisService); + httpSoap12Endpoint.setTransportInDescription(protocol); + + populateSoap12Endpoint(axisService, httpSoap12Endpoint, null); + axisService.addEndpoint(httpSoap12Endpoint.getName(), httpSoap12Endpoint); + } + public static void addHttpEndpoint(AxisService axisService, String url) { String protocol = org.apache.axis2.util.Utils.getURIScheme(url); String httpEndpointName = getEndpointName(axisService, protocol, null); @@ -1230,6 +1254,16 @@ public class Utils { axisService.addEndpoint(httpEndpoint.getName(), httpEndpoint); } + public static void addHttpEndpoint(AxisService axisService, + String protocol, String endpointName) { + AxisEndpoint httpEndpoint = new AxisEndpoint(); + httpEndpoint.setName(endpointName); + httpEndpoint.setParent(axisService); + httpEndpoint.setTransportInDescription(protocol); + populateHttpEndpoint(axisService, httpEndpoint, null); + axisService.addEndpoint(httpEndpoint.getName(), httpEndpoint); + } + public static void processPolicyAttachments(Iterator attachmentElements, AxisService service) throws XMLStreamException, FactoryConfigurationError { Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?rev=1067399&r1=1067398&r2=1067399&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original) +++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Sat Feb 5 06:49:45 2011 @@ -21,11 +21,12 @@ package org.apache.axis2.jaxws.descripti import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; -import org.apache.axis2.deployment.util.Utils; import org.apache.axis2.Constants.Configuration; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.deployment.util.Utils; import org.apache.axis2.description.AxisService; +import org.apache.axis2.description.AxisEndpoint; import org.apache.axis2.description.AxisServiceGroup; import org.apache.axis2.description.OutInAxisOperation; import org.apache.axis2.description.OutOnlyAxisOperation; @@ -1066,8 +1067,11 @@ public class EndpointDescriptionImpl axisService.setName(getServiceDescription().getServiceQName().getLocalPart()); axisService.setParent(axisConfig); - //populate all existing bindings.. - Utils.setEndpointsToAllUsedBindings(axisService); + // we always get only one endpoint as there's only one port in the generated WSDL + // from wsgen. Set the transport for that endpoint as http by default. + for (AxisEndpoint axisEndpoint : axisService.getEndpoints().values()) { + axisEndpoint.setTransportInDescription("http"); + } } catch (AxisFault e) { throw ExceptionFactory.makeWebServiceException(Messages @@ -1105,6 +1109,25 @@ public class EndpointDescriptionImpl } axisService = new AxisService(serviceName); + // Now we have to add an Endpoint to the AxisService instance according to the generated + // WSDL. Binding type can be SOAP 1.1, SOAP 1.2 or HTTP. Always we have to use the + // annotated port name as the endpoint name. + try { + String bindingType = getBindingType(); + // Default transport protocol is set to HTTP + String protocol = "http"; + if (bindingType.startsWith(SOAPBinding.SOAP12HTTP_BINDING)) { + Utils.addSoap12Endpoint(axisService, protocol, getPortQName().getLocalPart()); + } else if (bindingType.startsWith(javax.xml.ws.http.HTTPBinding.HTTP_BINDING)) { + Utils.addHttpEndpoint(axisService, protocol, getPortQName().getLocalPart()); + } else { + // Assume SOAP 1.1 over HTTP for all other cases + Utils.addSoap11Endpoint(axisService, protocol, getPortQName().getLocalPart()); + } + } catch (Exception e) { + log.error("Error while generating the Endpoint for service :" + axisService.getName()); + } + } private void releaseAxisServiceResources() { @@ -1257,14 +1280,7 @@ public class EndpointDescriptionImpl //This should eventually be deprecated in favor 'createAxisServiceNameFromDBL private String createAxisServiceName() { - String portName = null; - if (portQName != null) { - portName = portQName.getLocalPart(); - } else { - portName = "NoPortNameSpecified"; - - } - return getServiceDescription().getServiceQName().getLocalPart() + "." + portName; + return getServiceDescription().getServiceQName().getLocalPart(); } public boolean isWSDLFullySpecified() {