cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: org.apache.cxf.endpoint.Client usage
Date Wed, 12 Dec 2007 17:21:09 GMT

Davide,

It's possible that the first example is using the wsdl and the second 
isn't.   Can you try:

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(ManagedElementMgr.class);
factory.setAddress("http://localhost:8080/mtosi/v1/ManagedElementMgr")
factory.setWsdlLocation("http://localhost:8080/mtosi/v1/ManagedElementMgr?wsdl");
Client client = ClientProxy.getClient(factory.create());

Actually, another thing to try with the first one is to get the Client 
from the mgr and see if the dynamic way works with it:

ManagedElementMgr mgr = service.getManagedElementMgrHttp(); // PORT
Client client = ClientProxy.getClient(mgr);
client.invoke(......);

Since it's a server side stack trace, I'd like to see the generated soap 
messages if at all possible just to see how they are different.   One 
way would be to add the LoggingOutInterceptor to the client side. 

Dan



On Wednesday 12 December 2007, Davide Gesino wrote:
> I am trying to add client interceptors programmatically and need some
> help to user the Client interface.
> here is the snippet of code:
>
> // WITHOUT DYNAMIC CLIENT
> ConfigurationService service = new ConfigurationService(); //SERVICE
> ManagedElementMgr mgr = service.getManagedElementMgrHttp(); // PORT
> Holder<HeaderT> holder = new Holder<HeaderT>(); //PARAM 1
> GetAllManagedElementsResponseT response =
>     mgr.getAllManagedElements(holder, new GetAllManagedElementsT());
> // WS CALL
>
> //WITH DYNAMIC CLIENT
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.setServiceClass(ManagedElementMgr.class);
> factory.setAddress("http://localhost:8080/mtosi/v1/ManagedElementMgr")
>; Client client = ClientProxy.getClient(factory.create());
> IteratorClientInterceptor inter = new IteratorClientInterceptor(); //
> ADD MY ITERCEPTOR
> client.what?????
>
> I don't know how to invoke the client.
> I havev tried:
> client.invoke("getAllManagedElements",holder,new
> GetAllManagedElements());
>
> but I get an exception:
>
> org.apache.cxf.interceptor.Fault: Message part {tmf854.v1}header was
> not recognized.	at
> org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLi
>teralInInterceptor.java:179) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
>rChain.java:207) at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitia
>tionObserver.java:73) at
> org.apache.cxf.transport.servlet.ServletDestination.doMessage(ServletD
>estination.java:79) at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(S
>ervletController.java:256) at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletContr
>oller.java:160) at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXF
>Servlet.java:170) at
> org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXF
>Servlet.java:148) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:713) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
>cationFilterChain.java:269) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
>lterChain.java:188) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
>lve.java:210) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
>lve.java:174) at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
>va:127) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
>va:117) at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
>e.java:108) at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
>:151) at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
>870) at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.pr
>ocessConnection(Http11BaseProtocol.java:665) at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoi
>nt.java:528) at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFoll
>owerWorkerThread.java:81) at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo
>ol.java:685) at java.lang.Thread.run(Unknown Source)
>
>
> WHATAM I MISSING??



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message