Author: barrettj
Date: Fri Feb 11 17:11:59 2011
New Revision: 1069898

URL: http://svn.apache.org/viewvc?rev=1069898&view=rev
Log:
AXIS2-4948
Patch contributed by Katherine Sanders.  Wrong WSDL location returned by 
BindingProvider; was using the local filesystem path instead of the endpoint 
URL.

Modified:
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/resourceinjection.wsdl
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/META-INF/resourceinjection.wsdl
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/ResourceInjectionPortTypeImpl.java
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionPortType.java
    
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionService.java
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/resourceinjection.wsdl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/resourceinjection.wsdl?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/resourceinjection.wsdl
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test-resources/wsdl/resourceinjection.wsdl
 Fri Feb 11 17:11:59 2011
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 
-<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://resourceinjection.sample.test.org"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; name="ResourceInjection" 
targetNamespace="http://resourceinjection.sample.test.org";>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://resourceinjection.sample.jaxws.axis2.apache.org"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; name="ResourceInjection" 
targetNamespace="http://resourceinjection.sample.jaxws.axis2.apache.org";>
   <wsdl:types>
-    <xsd:schema targetNamespace="http://resourceinjection.sample.test.org"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+    <xsd:schema 
targetNamespace="http://resourceinjection.sample.jaxws.axis2.apache.org"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
       <xsd:element name="echoResponse">
        <xsd:complexType>
                <xsd:sequence>
@@ -53,7 +53,7 @@
   <wsdl:binding name="ResourceInjectionBinding" 
type="tns:ResourceInjectionPortType">
     <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
     <wsdl:operation name="echo">
-      <soap:operation 
soapAction="http://resourceinjection.sample.test.org/NewOperation"/>
+      <soap:operation 
soapAction="http://resourceinjection.sample.jaxws.axis2.apache.org/NewOperation"/>
       <wsdl:input>
         <soap:body use="literal"/>
       </wsdl:input>

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/ResourceInjectionTests.java
 Fri Feb 11 17:11:59 2011
@@ -19,14 +19,15 @@
 
 package org.apache.axis2.jaxws.sample;
 
+import javax.xml.ws.BindingProvider;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
+
 import org.apache.axis2.jaxws.framework.AbstractTestCase;
 import 
org.apache.axis2.jaxws.sample.resourceinjection.sei.ResourceInjectionPortType;
 import 
org.apache.axis2.jaxws.sample.resourceinjection.sei.ResourceInjectionService;
 
-import javax.xml.ws.BindingProvider;
-
 public class ResourceInjectionTests extends AbstractTestCase {
     String axisEndpoint = 
"http://localhost:6060/axis2/services/ResourceInjectionService.ResourceInjectionPortTypeImplPort";;
        
@@ -66,4 +67,30 @@ public class ResourceInjectionTests exte
         
     }
    
+    /*
+     * TODO:  This test is currently disabled.  The path tested assumes the 
webcontainer will
+     * receive the request for <EPR_address>/?wsdl and redirect appropriately 
to either
+     * the on-disk WSDL or, if an on-disk WSDL does not exist, a generated 
WSDL.  The
+     * Axis2 test webserver/webcontainer has no such ability currently.  To 
support this,
+     * the test SimpleServer would have to be coded to detect inbound requests 
appended with
+     * /?wsdl and redirect accordingly.
+     *
+     * See: 
jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java line 146
+     */ 
+    public void _testResourceInjectionEndpointReference() {
+        ResourceInjectionPortType proxy = getProxy();
+        String response = proxy.testInjection("epr");
+        assertTrue("The response was null", response != null);
+        assertTrue("The response was not succesful: " + response, response
+                .indexOf("SUCCESS") >= 0);
+
+        // Make sure the EPR contains the fields we expect
+        assertTrue("The EPR did not contain EndpointReference", response
+                .indexOf("EndpointReference") >= 0);
+        assertTrue("The EPR did not contain ServiceName", response
+                .indexOf("ServiceName") >= 0);
+        assertTrue("The EPR did not contain wsdlLocation", response
+                .indexOf("wsdlLocation") >= 0);
+    }
+   
 }

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/META-INF/resourceinjection.wsdl
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/META-INF/resourceinjection.wsdl?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/META-INF/resourceinjection.wsdl
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/META-INF/resourceinjection.wsdl
 Fri Feb 11 17:11:59 2011
@@ -19,9 +19,9 @@
   ~ under the License.
   -->
 
-<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://resourceinjection.sample.test.org"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="ResourceInjection" 
targetNamespace="http://resourceinjection.sample.test.org";>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://resourceinjection.sample.jaxws.axis2.apache.org"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="ResourceInjection" 
targetNamespace="http://resourceinjection.sample.jaxws.axis2.apache.org";>
   <wsdl:types>
-    <xsd:schema targetNamespace="http://resourceinjection.sample.test.org"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
+    <xsd:schema 
targetNamespace="http://resourceinjection.sample.jaxws.axis2.apache.org"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
       <xsd:element name="testInjectionResponse">
        <xsd:complexType>
                <xsd:sequence>
@@ -53,7 +53,7 @@
   <wsdl:binding name="ResourceInjectionBinding" 
type="tns:ResourceInjectionPortType">
     <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
     <wsdl:operation name="testInjection">
-      <soap:operation 
soapAction="http://resourceinjection.sample.test.org/testInjection"/>
+      <soap:operation 
soapAction="http://resourceinjection.sample.jaxws.axis2.apache.org/testInjection"/>
       <wsdl:input>
         <soap:body use="literal"/>
       </wsdl:input>
@@ -67,4 +67,4 @@
       <soap:address 
location="http://localhost:6060/axis2/services/ResourceInjectionService"/>
     </wsdl:port>
   </wsdl:service>
-</wsdl:definitions>
\ No newline at end of file
+</wsdl:definitions>

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/ResourceInjectionPortTypeImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/ResourceInjectionPortTypeImpl.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/ResourceInjectionPortTypeImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/ResourceInjectionPortTypeImpl.java
 Fri Feb 11 17:11:59 2011
@@ -28,6 +28,7 @@ import javax.annotation.PreDestroy;
 import javax.annotation.Resource;
 import javax.jws.WebService;
 import javax.xml.namespace.QName;
+import javax.xml.ws.EndpointReference;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.handler.MessageContext;
 
@@ -36,6 +37,7 @@ import javax.xml.ws.handler.MessageConte
  *
  */
 @WebService(serviceName="ResourceInjectionService",
+            wsdlLocation="META-INF/resourceinjection.wsdl",
             
endpointInterface="org.apache.axis2.jaxws.sample.resourceinjection.sei.ResourceInjectionPortType")
             public class ResourceInjectionPortTypeImpl implements 
ResourceInjectionPortType {
 
@@ -50,10 +52,29 @@ import javax.xml.ws.handler.MessageConte
      */
     public String testInjection(String arg) {
         
-        
         if (ctx == null) {
             return "FAILURE: The WebServiceContext was not set";
         }
+
+        if ("sample".equals(arg)) {
+            return basicInjectionTest();
+        } else if ("epr".equals(arg)) {
+            return eprInjectionTest();
+        } else {
+            return "FAILURE: Unexpected test type " + arg;
+        }
+    }
+
+    private String eprInjectionTest() {
+        EndpointReference epr = ctx.getEndpointReference();
+
+        if (epr == null) {
+            return "FAILURE: The context did not return and endpoint 
reference";
+        }
+        return "SUCCESS: " + epr.toString();
+    }
+
+    private String basicInjectionTest() {
         
         MessageContext msgContext = ctx.getMessageContext();
         if (msgContext == null) {

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionPortType.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionPortType.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionPortType.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionPortType.java
 Fri Feb 11 17:11:59 2011
@@ -27,7 +27,7 @@ import javax.jws.WebService;
 import javax.xml.ws.RequestWrapper;
 import javax.xml.ws.ResponseWrapper;
 
-@WebService(name = "ResourceInjectionPortType", targetNamespace = 
"http://resourceinjection.sample.test.org";)
+@WebService(name = "ResourceInjectionPortType", targetNamespace = 
"http://resourceinjection.sample.jaxws.axis2.apache.org";)
 public interface ResourceInjectionPortType {
 
 
@@ -37,10 +37,10 @@ public interface ResourceInjectionPortTy
      * @return
      *     returns java.lang.String
      */
-    @WebMethod(action = 
"http://resourceinjection.sample.test.org/NewOperation";)
+    @WebMethod(action = 
"http://resourceinjection.sample.jaxws.axis2.apache.org/NewOperation";)
     @WebResult(name = "response", targetNamespace = "")
-    @RequestWrapper(localName = "testInjection", targetNamespace = 
"http://resourceinjection.sample.test.org";, className = 
"org.test.sample.resourceinjection.TestInjection")
-    @ResponseWrapper(localName = "testInjectionResponse", targetNamespace = 
"http://resourceinjection.sample.test.org";, className = 
"org.test.sample.resourceinjection.TestInjectionResponse")
+    @RequestWrapper(localName = "testInjection", targetNamespace = 
"http://resourceinjection.sample.jaxws.axis2.apache.org";, className = 
"org.apache.axis2.jaxws.sample.resourceinjection.TestInjection")
+    @ResponseWrapper(localName = "testInjectionResponse", targetNamespace = 
"http://resourceinjection.sample.jaxws.axis2.apache.org";, className = 
"org.apache.axis2.jaxws.sample.resourceinjection.TestInjectionResponse")
     public String testInjection(
         @WebParam(name = "arg", targetNamespace = "")
         String arg);

Modified: 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionService.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionService.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionService.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/resourceinjection/sei/ResourceInjectionService.java
 Fri Feb 11 17:11:59 2011
@@ -28,7 +28,7 @@ import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
 
-@WebServiceClient(name = "ResourceInjectionService", targetNamespace = 
"http://resourceinjection.sample.test.org";, wsdlLocation = 
"resourceinjection.wsdl")
+@WebServiceClient(name = "ResourceInjectionService", targetNamespace = 
"http://resourceinjection.sample.jaxws.axis2.apache.org";, wsdlLocation = 
"resourceinjection.wsdl")
 public class ResourceInjectionService
     extends Service
 {
@@ -58,7 +58,7 @@ public class ResourceInjectionService
     }
 
     public ResourceInjectionService() {
-        super(RESOURCEINJECTIONSERVICE_WSDL_LOCATION, new 
QName("http://resourceinjection.sample.test.org";, "ResourceInjectionService"));
+        super(RESOURCEINJECTIONSERVICE_WSDL_LOCATION, new 
QName("http://resourceinjection.sample.jaxws.axis2.apache.org";, 
"ResourceInjectionService"));
     }
 
     /**
@@ -68,7 +68,7 @@ public class ResourceInjectionService
      */
     @WebEndpoint(name = "ResourceInjectionPort")
     public ResourceInjectionPortType getResourceInjectionPort() {
-        return (ResourceInjectionPortType)super.getPort(new 
QName("http://resourceinjection.sample.test.org";, "ResourceInjectionPort"), 
ResourceInjectionPortType.class);
+        return (ResourceInjectionPortType)super.getPort(new 
QName("http://resourceinjection.sample.jaxws.axis2.apache.org";, 
"ResourceInjectionPort"), ResourceInjectionPortType.class);
     }
 
 }

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
 Fri Feb 11 17:11:59 2011
@@ -32,7 +32,6 @@ import org.apache.axis2.jaxws.core.Invoc
 import org.apache.axis2.jaxws.core.MessageContext;
 import org.apache.axis2.jaxws.description.EndpointDescription;
 import org.apache.axis2.jaxws.description.ServiceDescription;
-import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
 import org.apache.axis2.jaxws.handler.HandlerResolverImpl;
 import org.apache.axis2.jaxws.i18n.Messages;
 import org.apache.axis2.jaxws.spi.ServiceDelegate;
@@ -409,7 +408,7 @@ public class BindingProvider implements 
                     address = endpointDesc.getEndpointAddress();
                 QName service = endpointDesc.getServiceQName();
                 QName port = endpointDesc.getPortQName();
-                String wsdlLocation = ((ServiceDescriptionWSDL) 
endpointDesc.getServiceDescription()).getWSDLLocation();
+                String wsdlLocation = "/?wsdl";  // let the webcontainer 
redirect us to the real WSDL URL; it knows where it is
 
                 epr = 
EndpointReferenceUtils.createAxis2EndpointReference(address, service, port, 
wsdlLocation, addressingNamespace);
                 

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/addressing/factory/impl/Axis2EndpointReferenceFactoryImpl.java
 Fri Feb 11 17:11:59 2011
@@ -19,6 +19,11 @@
 
 package org.apache.axis2.jaxws.addressing.factory.impl;
 
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.jaxws.ExceptionFactory;
@@ -30,15 +35,17 @@ import org.apache.axis2.jaxws.addressing
 import org.apache.axis2.jaxws.i18n.Messages;
 import org.apache.axis2.jaxws.util.WSDL4JWrapper;
 import org.apache.axis2.jaxws.util.WSDLWrapper;
-
-import javax.xml.namespace.QName;
-import java.net.URL;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * This class produces instances of {@link EndpointReference}.
  *
  */
 public class Axis2EndpointReferenceFactoryImpl implements 
Axis2EndpointReferenceFactory {
+    
+    private static final Log log = 
LogFactory.getLog(Axis2EndpointReferenceFactoryImpl.class);
+    
     public Axis2EndpointReferenceFactoryImpl() {
        super();
     }
@@ -111,12 +118,33 @@ public class Axis2EndpointReferenceFacto
             EndpointReferenceUtils.addService(axis2EPR, serviceName, portName, 
addressingNamespace);
 
             if (wsdlDocumentLocation != null) {
-               URL wsdlURL = new URL(wsdlDocumentLocation);
+                
+                URL wsdlURL;
+                try {
+                    wsdlURL = new URL(wsdlDocumentLocation);
+                } catch (MalformedURLException e) {
+                    // just to keep it clean:
+                    if (axis2EPR.getAddress().endsWith("/") && 
wsdlDocumentLocation.startsWith("/")) {
+                        wsdlDocumentLocation = axis2EPR.getAddress() + 
wsdlDocumentLocation.substring(1);
+                    } else {
+                        wsdlDocumentLocation = axis2EPR.getAddress() + 
wsdlDocumentLocation;
+                    }
+                }
+                
+               wsdlURL = new URL(wsdlDocumentLocation);
                // This is a temporary usage, so use a memory sensitive wrapper
                 WSDLWrapper wrapper = new WSDL4JWrapper(wsdlURL, true, 2);
                
                 if (serviceName != null) {
-                    if (wrapper.getService(serviceName) == null) {
+                    
+                    QName serviceNameNoTrailingSlash = new QName("");
+                    // TODO: why in the world would we have to do this?
+                    if (serviceName.getNamespaceURI().endsWith("/")) {
+                        String ns = serviceName.getNamespaceURI();
+                        serviceNameNoTrailingSlash = new QName(ns.substring(0, 
ns.length()-1), serviceName.getLocalPart());
+                    }
+                    
+                    if ((wrapper.getService(serviceName) == null) && 
(wrapper.getService(serviceNameNoTrailingSlash) == null)) {
                         throw new IllegalStateException(
                             Messages.getMessage("MissingServiceName", 
                                                 serviceName.toString(), 
@@ -124,12 +152,18 @@ public class Axis2EndpointReferenceFacto
                     }
                     if (portName != null) {
                         String[] ports = wrapper.getPorts(serviceName);
+                        // search the other name.  TODO: again, why do we have 
to do this?
+                        if (ports == null) {
+                            ports = 
wrapper.getPorts(serviceNameNoTrailingSlash);
+                        }
                         String portLocalName = portName.getLocalPart();
                         boolean found = false;
 
                         if (ports != null) {
                             for (String port : ports) {
-                                if (port.equals(portLocalName)) {
+                                // TODO: axis2 perhaps is deploying with 
"TypeImplPort" appended, but not reading/honoring the WSDL?
+                                if (port.equals(portLocalName) || (port + 
"TypeImplPort").equals(portLocalName)) {
+                                    log.debug("found port: " + port);
                                     found = true;
                                     break;
                                 }
@@ -142,6 +176,7 @@ public class Axis2EndpointReferenceFacto
                                                              
portName.toString(), 
                                                              
wsdlDocumentLocation)); 
                         }
+                        log.debug("Setting wsdlDocumentLocation to " + 
wsdlDocumentLocation + " for EndpointReference at port " + portName);
                         EndpointReferenceUtils.addLocation(axis2EPR, 
portName.getNamespaceURI(), wsdlDocumentLocation, addressingNamespace);
                     }
                 }

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java?rev=1069898&r1=1069897&r2=1069898&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
 Fri Feb 11 17:11:59 2011
@@ -32,6 +32,8 @@ import javax.xml.ws.EndpointReference;
 import javax.xml.ws.WebServiceContext;
 import javax.xml.ws.handler.MessageContext;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import java.net.URI;
 import java.security.Principal;
 
 public class WebServiceContextImpl implements WebServiceContext {
@@ -141,9 +143,10 @@ public class WebServiceContextImpl imple
         if (soapMessageContext != null) {
             QName service = (QName) 
soapMessageContext.get(MessageContext.WSDL_SERVICE);
             QName endpoint = (QName) 
soapMessageContext.get(MessageContext.WSDL_PORT);
+            String wsdlLocation = "/?wsdl";  // let the webcontainer redirect 
us to the real WSDL URL; it knows where it is
             
             org.apache.axis2.addressing.EndpointReference axis2EPR =
-                EndpointReferenceUtils.createAxis2EndpointReference(null, 
service, endpoint, null, addressingNamespace);
+                EndpointReferenceUtils.createAxis2EndpointReference(null, 
service, endpoint, wsdlLocation, addressingNamespace);
             
             try {
                 EndpointReferenceUtils.addReferenceParameters(axis2EPR, 
referenceParameters);


Reply via email to