开发者

Invoke web-services in JSF

开发者 https://www.devze.com 2022-12-23 05:11 出处:网络
I nee开发者_C百科d to write invoker for web services in JSF. Any guidlines you can give me? Which lib(API) should I use?

I nee开发者_C百科d to write invoker for web services in JSF. Any guidlines you can give me? Which lib(API) should I use?

Thanks


The way you access web services from your code (managed beans perhaps?) does not depend on JSF. CXF and Metro are both implementations of JAX-WS, using which you can implement web-service client code.


You can implement web services clients dynamically using CXF library.

In order to avoid some error like "No Factories configured for this Application" using a CXF Dynamic Client and JSF, you must to do something like this:

ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
Client client = dcf.createClient("ws.strikeiron.com/IPLookup2?WSDL");
Thread.currentThread().setContextClassLoader(classLoader);
0

精彩评论

暂无评论...
验证码 换一张
取 消