You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by William Tam <em...@gmail.com> on 2012/01/12 00:20:32 UTC
Re: base-address for CXF
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:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
>
>
>
>
>
>
>
>
>
>
Re: base-address for CXF
Posted by William Tam <em...@gmail.com>.
Finally, I got a chance to follow up. Thanks Freeman for creating a
Jira and addressing the issue.
On 01/16/2012 01:08 AM, Freeman Fang wrote:
> Hi William,
>
> Sorry for the late response, last week I was on travel so can't catch
> email in time.
>
> Your suggestion looks good for me, could you please raise a jira and
> append a patch?
>
> Thanks
> Freeman
> On 2012-1-14, at 上午3:40, William Tam wrote:
>
>> 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:ffang@fusesource.com
>>>> Web: fusesource.com
>>>> Twitter: freemanfang
>>>> Blog: http://freemanfang.blogspot.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:ffang@fusesource.com
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
>
>
>
>
>
>
>
>
>
>
Re: base-address for CXF
Posted by Freeman Fang <fr...@gmail.com>.
Hi William,
Sorry for the late response, last week I was on travel so can't catch
email in time.
Your suggestion looks good for me, could you please raise a jira and
append a patch?
Thanks
Freeman
On 2012-1-14, at 上午3:40, William Tam wrote:
> 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:ffang@fusesource.com
>>> Web: fusesource.com
>>> Twitter: freemanfang
>>> Blog: http://freemanfang.blogspot.com
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
---------------------------------------------
Freeman Fang
FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Re: base-address for CXF
Posted by William Tam <em...@gmail.com>.
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:ffang@fusesource.com
>> Web: fusesource.com
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>