Anyone else can response, too.   (Perhaps, Freeman is unavailable).

Thanks.

On 01/11/2012 06:20 PM, William Tam wrote:
Hi Freeman,

I think I see an issue that can prevent publishedEndpointUrl property to be set on EndpointInfo object if the endpoint is created by a non-jaxws frontend. (it is done when org.apache.cxf.jaxws.EndpointImp.doPublish() is called)

In AbstractWSDLBasedEndpointFactory, the following snippet will set publishedEndpointUrl property which is inside createEndpointInfo() method.

if (publishedEndpointUrl != null && !"".equals(publishedEndpointUrl)) {
            ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
        }

However, the EndpointInfo object could be created by other factories (e.g. SoapTransportFactory) and so the AbstractWSDLBasedEndpointFactory.createEndpointInfo() method may not be called at all. As a result, the publishedEndpointUrl may not be set.

I would suggest moving the snippet to the createEndpoint() need line 159. (see diff from trunk below). That way, the publishedEndpointUrl is set on EndpointInfo regardless how it was created.

Index: src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java
===================================================================
--- src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java (revision 1229797) +++ src/main/java/org/apache/cxf/frontend/AbstractWSDLBasedEndpointFactory.java (working copy)
@@ -157,6 +157,10 @@
             ei.setAddress(getAddress());
         }

+ if (publishedEndpointUrl != null && !"".equals(publishedEndpointUrl)) { + ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
+        }
+
         if (endpointReference != null) {
             ei.setAddress(endpointReference);
         }
@@ -294,10 +298,6 @@
         ei.setAddress(getAddress());
         ei.setBinding(bindingInfo);

- if (publishedEndpointUrl != null && !"".equals(publishedEndpointUrl)) { - ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
-        }
-
         if (wsdlEndpointFactory != null) {
             wsdlEndpointFactory.createPortExtensors(ei, service);
         }

Thanks.

On 11/30/2011 07:59 PM, Freeman Fang wrote:

On 2011-11-30, at 下午9:30, rickthemick wrote:

I cant see that it works like you describe it.

Adding publishedEndpointUrl in my Spring conf:

<jaxws:endpoint id="MyServiceEndpoint" implementor="#myService"
   address="/myservice" >
<jaxws:properties>
<entry key="publishedEndpointUrl" value="myserver" />
</jaxws:properties>
</jaxws:endpoint>
Hi,

You need change the publishedEndpointUrl value to http://myserver/cxf/myservice Also in the Service List Page, you can find the wsdl URL there is http://myserver/cxf/myservice?wsdl.
I just tested it with 2.4.4, it works for me.

Freeman

- Does not affect the service listing, I dont get "myserver" as host for the
services.
- And in the WSDL, it affects the whole service URL, not just the
host/server part:
<wsdl:port binding="tns:ConfigDbServiceImplServiceSoapBinding"
name="ConfigDbServiceImplPort">
<soap:address location="myserver"/>
</wsdl:port>

 It should be: http://myserver/cxf/myservice I believe.
- Even if it would work, I dont want to control this in the "code" (the
spring config in the service bundle).

In my understanding its still base-address that would solve my problem, but I dont know how to make it affective and I havent found the definition of it
either.




--
View this message in context: http://cxf.547215.n5.nabble.com/base-address-for-CXF-tp5034937p5035493.html
Sent from the cxf-user mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ff...@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Reply via email to