Author: dims Date: Wed Mar 5 13:27:09 2008 New Revision: 634038 URL: http://svn.apache.org/viewvc?rev=634038&view=rev Log: Fix for AXIS2-3569 - javax.xml.ws.handler.MessageContext.WSDL_DESCRIPTION not populated correctly
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/context/tests/MessageContextTests.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/context/tests/MessageContextTests.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/context/tests/MessageContextTests.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/context/tests/MessageContextTests.java (original) +++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/context/tests/MessageContextTests.java Wed Mar 5 13:27:09 2008 @@ -63,12 +63,11 @@ runTest(javax.xml.ws.handler.MessageContext.WSDL_INTERFACE, type_expected, value_expected, false); } -// FIXME: Please fix this test, it does not work. -// public void testWSCtxt_WSDL_DESCRIPTION_read() { -// String type_expected = java.net.URI.class.getName(); -// String value_expected = "META-INF/MessageContext.wsdl"; -// runTest(javax.xml.ws.handler.MessageContext.WSDL_DESCRIPTION, type_expected, value_expected, false); -// } + public void testWSCtxt_WSDL_DESCRIPTION_read() { + String type_expected = java.net.URI.class.getName(); + String value_expected = "META-INF/MessageContext.wsdl"; + runTest(javax.xml.ws.handler.MessageContext.WSDL_DESCRIPTION, type_expected, value_expected, false); + } private void runTest(String propName, String exType, String exValue, boolean isValueFullySpecified) { MessageContext port = getPort(); Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java Wed Mar 5 13:27:09 2008 @@ -257,9 +257,7 @@ address = endpointDesc.getEndpointAddress(); QName service = endpointDesc.getServiceQName(); QName port = endpointDesc.getPortQName(); - URL wsdlURL = - ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation(); - String wsdlLocation = (wsdlURL != null) ? wsdlURL.toString() : null; + String wsdlLocation = ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation(); epr = EndpointReferenceUtils.createAxis2EndpointReference(address, service, port, wsdlLocation, addressingNamespace); } Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java Wed Mar 5 13:27:09 2008 @@ -68,11 +68,11 @@ ServiceDescription sd = description.getServiceDescription(); if (sd != null) { - URL wsdlLocation = ((ServiceDescriptionWSDL)sd).getWSDLLocation(); + String wsdlLocation = ((ServiceDescriptionWSDL)sd).getWSDLLocation(); if (wsdlLocation != null && !"".equals(wsdlLocation)) { URI wsdlLocationURI = null; try { - wsdlLocationURI = wsdlLocation.toURI(); + wsdlLocationURI = new URI(wsdlLocation); } catch (URISyntaxException ex) { log.warn(Messages.getMessage("addPropertiesErr", Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java Wed Mar 5 13:27:09 2008 @@ -44,6 +44,7 @@ import java.net.URL; import java.net.URI; import java.net.URISyntaxException; +import java.net.MalformedURLException; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; @@ -230,9 +231,7 @@ String address = endpointDesc.getEndpointAddress(); QName serviceName = endpointDesc.getServiceQName(); QName portName = endpointDesc.getPortQName(); - URL wsdlURL = - ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation(); - String wsdlLocation = (wsdlURL != null) ? wsdlURL.toString() : null; + String wsdlLocation = ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation(); if (!BindingUtils.isSOAPBinding(binding.getBindingID())) throw new UnsupportedOperationException("This method is unsupported for the binding: " + binding.getBindingID()); Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java (original) +++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java Wed Mar 5 13:27:09 2008 @@ -57,6 +57,7 @@ import java.lang.reflect.Proxy; import java.net.URL; +import java.net.MalformedURLException; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Iterator; @@ -603,7 +604,16 @@ * @see javax.xml.ws.spi.ServiceDelegate#getWSDLDocumentLocation() */ public URL getWSDLDocumentLocation() { - return ((ServiceDescriptionWSDL)serviceDescription).getWSDLLocation(); + try { + String wsdlLocation = ((ServiceDescriptionWSDL) serviceDescription).getWSDLLocation(); + if(wsdlLocation == null) { + return null; + } + return new URL(wsdlLocation); + } catch (MalformedURLException e) { + throw ExceptionFactory + .makeWebServiceException(e); + } } /* Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java Wed Mar 5 13:27:09 2008 @@ -54,7 +54,7 @@ */ public List<Port> getWSDLPortsUsingSOAPAddress(List<Port> wsdlPorts); - public abstract URL getWSDLLocation(); + public abstract String getWSDLLocation(); public Definition getWSDLDefinition(); Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?rev=634038&r1=634037&r2=634038&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original) +++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Wed Mar 5 13:27:09 2008 @@ -66,6 +66,7 @@ import java.net.ConnectException; import java.net.URL; import java.net.UnknownHostException; +import java.net.MalformedURLException; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; @@ -85,7 +86,7 @@ private ClientConfigurationFactory clientConfigFactory; private ConfigurationContext configContext; - private URL wsdlURL; + private String wsdlURL; private QName serviceQName; // TODO: Possibly remove Definition and delegate to the Defn on the AxisSerivce set as a paramater by WSDLtoAxisServicBuilder? @@ -193,9 +194,9 @@ if (log.isDebugEnabled()) { log.debug("Wsdl location overriden by sparse composite; overriden value: " + this.wsdlURL); } - this.wsdlURL = sparseCompositeWsdlURL; + this.wsdlURL = sparseCompositeWsdlURL == null ? null : sparseCompositeWsdlURL.toString(); } else { - this.wsdlURL = wsdlURL; + this.wsdlURL = wsdlURL == null ? null : wsdlURL.toString(); } if (log.isDebugEnabled()) { log.debug("Wsdl Location value used: " + this.wsdlURL); @@ -677,7 +678,8 @@ (!(composite.getWebServiceProviderAnnot() == null))) { //This is either an implicit SEI, or a WebService Provider if (composite.getWsdlDefinition() != null) { - this.wsdlURL = composite.getWsdlURL(); + URL url = composite.getWsdlURL(); + this.wsdlURL = url == null ? null : url.toString(); try { if (log.isDebugEnabled() ) { @@ -687,13 +689,16 @@ log.debug("new WSDL4JWrapper-ConfigContext null1"); } } - this.wsdlWrapper = new WSDL4JWrapper(this.wsdlURL, + this.wsdlWrapper = new WSDL4JWrapper(new URL(this.wsdlURL), composite.getWsdlDefinition(), configContext, this.catalogManager); } catch (WSDLException e) { throw ExceptionFactory.makeWebServiceException( Messages.getMessage("wsdlException", e.getMessage()), e); + } catch (MalformedURLException e) { + throw ExceptionFactory.makeWebServiceException( + Messages.getMessage("wsdlException", e.getMessage()), e); } } else { String wsdlLocation = null; @@ -727,8 +732,8 @@ if (log.isDebugEnabled()) { log.debug("Get the wsdl definition from the SEI composite."); } - - this.wsdlURL = seic.getWsdlURL(); + URL url = seic.getWsdlURL(); + this.wsdlURL = url.toString(); if (log.isDebugEnabled() ) { if (configContext != null) { log.debug("new WSDL4JWrapper-ConfigContext not null2"); @@ -754,7 +759,8 @@ log.debug("new WSDL4JWrapper-ConfigContext null3"); } } - this.wsdlURL = composite.getWsdlURL(); + URL url = composite.getWsdlURL(); + this.wsdlURL = url == null ? null : url.toString(); this.wsdlWrapper = new WSDL4JWrapper(composite.getWsdlURL(), composite.getWsdlDefinition(), configContext, @@ -788,7 +794,8 @@ if (log.isDebugEnabled()) { log.debug("wsdl location =" + wsdlLocation); } - setWSDLDefinitionOnDBC(wsdlLocation); + this.wsdlURL = wsdlLocation; + setWSDLDefinitionOnDBC(wsdlLocation); } } } catch (WSDLException e) { @@ -807,7 +814,7 @@ log.debug("new WSDL4JWrapper-ConfigContext null4"); } } - this.wsdlWrapper = new WSDL4JWrapper(this.wsdlURL,configContext, + this.wsdlWrapper = new WSDL4JWrapper(new URL(this.wsdlURL),configContext, this.catalogManager); } @@ -952,7 +959,7 @@ /* (non-Javadoc) * @see org.apache.axis2.jaxws.description.ServiceDescriptionWSDL#getWSDLLocation() */ - public URL getWSDLLocation() { + public String getWSDLLocation() { return wsdlURL; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]