Hi,
You code should be like
Client client =
((org.apache.cxf.jaxws.DispatchImpl)dispatchClient).getClient();
HTTPConduit conduit = (HTTPConduit) client.getConduit();
...
Freeman
On 2011-3-3, at 下午4:04, Blue Diamond wrote:
Hello All!
We use CXF for creating dynamic JAX-WS clients
(Dispatch<SOAPMessage>) for
our service. All is set.
Now I want to engage HTTPS. I am able to do it from cxf.xml file but
what I
need is, this to be done programmatically given the server URL is
dynamic.
This is where I am stuck.
*Code:*
*Client client = ClientProxy.getClient(dispatchClient);*
*HTTPConduit conduit = (HTTPConduit) client.getConduit();*
*
*
*Exception:*
Exception in thread "main" java.lang.IllegalArgumentException: not a
proxy
instance
at java.lang.reflect.Proxy.getInvocationHandler(Unknown Source)
at org.apache.cxf.frontend.ClientProxy.getClient(ClientProxy.java:93)
So, the mechanism provided works for JAX-WS clients but not dynamic
dispatch
based clients? What do I do in this? Does CXF support this? How to
get/configure conduit for my dispatch dynamically at runtime?
Need help...
Thanks & Regards,
Anil
--
Freeman Fang
------------------------
FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org