You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Valerio Schiavoni <va...@gmail.com> on 2009/05/01 11:13:16 UTC
changing endpointReference address
Hello,
i'm trying to modify the endpoint reference address using CXF API:
org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy
.getClient(ref);
Conduit conduit = client.getConduit();
EndpointReferenceType endpointRef = conduit.getTarget();
System.err.println("Original addr: "+endpointRef.getAddress().getValue());
EndpointReferenceUtils.setAddress(endpointRef,
"http://localhost:8080/Changed");
But, when the client emits an operation, the messages are still sent
to the original address, and not to
the one that I set manually.
The client is implemented by a set of classes generated by the
codegen-cxf-plugin.
What am I missing?
Thanks a lot,
valerio
--
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni
Re: changing endpointReference address
Posted by Valerio Schiavoni <va...@gmail.com>.
On Mon, May 4, 2009 at 10:54 AM, Valerio Schiavoni
<va...@gmail.com> wrote:
> client.getRequestContext().put(
> BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
> "http://localhost:8080/Changed");
Seems like the correct property was:
requestContext.put(Message.ENDPOINT_ADDRESS, uri);
not sure to understand the reasons for that. An old discussion about same topic:
https://issues.apache.org/jira/browse/CXF-414
didn't clarify my doubts..
--
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni
Re: changing endpointReference address
Posted by Valerio Schiavoni <va...@gmail.com>.
Hi again,
it seems like a different approach "could" work:
org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy
.getClient(ref);
client.getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:8080/Changed");
the problem is that the address set n the request is ignored, and the
request is still sent to the original address.
I'm using cxf 2.2.1
Any idea?
On Fri, May 1, 2009 at 11:13 AM, Valerio Schiavoni
<va...@gmail.com> wrote:
> Hello,
> i'm trying to modify the endpoint reference address using CXF API:
>
> org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy
> .getClient(ref);
> Conduit conduit = client.getConduit();
> EndpointReferenceType endpointRef = conduit.getTarget();
> System.err.println("Original addr: "+endpointRef.getAddress().getValue());
> EndpointReferenceUtils.setAddress(endpointRef,
> "http://localhost:8080/Changed");
>
>
> But, when the client emits an operation, the messages are still sent
> to the original address, and not to
> the one that I set manually.
> The client is implemented by a set of classes generated by the
> codegen-cxf-plugin.
> What am I missing?
>
> Thanks a lot,
> valerio
>
> --
> http://www.linkedin.com/in/vschiavoni
> http://jroller.com/vschiavoni
>
--
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni