_javascript_ Client Configuration has been edited by Benson Margulies (Dec 14, 2007).

(View changes)

Content:

If you want to use the _javascript_ client generator, your first decision is whether to generate _javascript_ files with the tools or whether to use the ?js URL handler. Using the tools has some advantages: you can easily read the _javascript_ and see the generated API, and you don't use runtime CPU time generating the _javascript_. On the other hand, you have to juggle the _javascript_ files. A more serious issue applies to code-first services. It can be tricky to ensure that you configure java2js with exactly the same configuration that your service establishes at runtime.

In either case, the only configurable item, in the _javascript_ client generator is the mapping of namespace URIs to _javascript_ object name prefixes. As of this writing, you can configure this either in the Spring configuration (or API) of your endpoint, or as command-line options to java2js. We expect to modify this to work with a WSDL/Spring schema extension, so early adopters may prefer to live with the default mapping at this time.

If you are planning to use the ?js URL handler, you must configure it onto your bus. If you use cxf.xml or cxf-servlet.xml to configure your services, the ?js URL handler will be included along with all the other bus extensions. If you build your own Spring configuration, you have to include META-INF/cxf/cxf-extension-_javascript_-client.xml in your bean configuration. If you are configuring a bus the hard way, add org.apache.cxf._javascript_._javascript_QueryHandlerRegistry to the bus and it will register the handler.

Reply via email to