开发者

Invoke web-services in JSF

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜