Alessio Soldano [
https://community.jboss.org/people/asoldano] modified the document:
"Wise-core Programmer Guide (version 2.0)"
To view the document, visit:
https://community.jboss.org/docs/DOC-48312
--------------------------------------------------------------
h2. What's new
Wise-core 2.0 is a major revisit of former 1.x version to make the project run on top of
JBoss Application Server 7.1 / 7.2 and use JBossWS (Apache CXF based) 4.x generation
stack.
The project module structure has also been updated to let it build with Apache Maven 3 and
to better isolate integratation testsuites.
h2. What is wise-core
Wise-core is a library to simplify web service invocation from a client point of view; it
aims at providing a near zero-code solution to parse wsdls, select service/port and call
operations by mapping a user defined object model to the JAX-WS objects required to
perform the call.
In other words wise-core aims at providing web services client invocation in a dynamic
manner.
While basic JAX-WS tool for wsdl-to-java generation (like wsconsume) are great for most
Java developer usecases, the generated stub classes kind of introduce a new (or renewed
:)) level of coupling very similar to Corba IDL; by generating statical webservice stubs
you actually couple client and server.
+So what is the alternative?+
Generating stubs at runtime and using dynamic mapping on generated stub.
+How does wise-core perform this generic task?+
In a nutshell it generates classes on the fly using +wsconsume+ runtime API, loading them
in current class loader and using them with Java Reflection API. What we add is a generic
mapping API to transform an arbitrary object model in the wsconsume generated ones, make
the call and map the answer back again to the custom model using Smooks. Moreover this is
achieved keeping the API general enough to plug in other mappers (perhaps custom ones) to
transform user defined object into JAX-WS generated objects.
Wise supports standard JAX-WS handlers too and a generic smooks transformation handler to
apply transformation to generated SOAP messages; currently there's also a basic
support for some WS-* specifications, which will be futher developed in the next future.
The key to understand the Wise-core idea is to keep in mind it is an API hiding JAX-WS
wsconsume tools to generate JAX-WS stub classes and providing API to invoke them in a
dynamic way using mappers to convert your own object model to JAX-WS generated one.
One of the most important aspects of this approach is that Wise delegates everything
concerning standards and interoperability to the underlying JAX-WS client implementation
(JBossWS / Apache CXF in the current implementation). In other words if an hand written
webservice client using JBossWS is interoperable and respects standards, the same applies
to a Wise-generated client! We are just adding commodities and dynamical transparent
generation and access to JAX-WS clients, we are not rewriting client APIs, the well tested
and working ones from JBossWS is fine with us.
h2. API description
Below is a description of Wise-core API, its goals and how it can be used in practice to
simplify your webservice client development. Anyway we strongly suggest you to take a look
at our javadoc as a more complete reference for the API.
The core elements of our API are:
* WSDynamicClient: This is the Wise core class responsible for the invocation of the
JAX-WS tools and that handles wsdl retrieval and parsing. It is used to build the list of
WSService representing the services published in parsed wsdl. It can also be used to
directly get the WSMethod to invoke the specified action on specified port of specified
service. It is the base method for "one line of code invocation". Each single
instance of this class is responsible of its own temp files, smooks instance and so on. It
is importanto to call close() method to dispose resources and clean temp directories.
* WSService: represents a single service. It can be used to retrieve the current service
endpoints (Ports).
* WSEndpoint: represents an Endpoint(Port) and has utility methods to edit username,
password, endpoint address, attach handlers, etc.
* WSMethod: represents a webservice operation(action) invocation and it always refers to a
specific endpoint. It is used for effective invocation of a web service action.
* WebParameter: holds single parameter's data required for an invocation
* InvocationResult: holds the webservice's invocation result data. Anyway it returns a
Map<String, Object> with webservice's call results, eventually applying a
mapping to custom objects using a WiseMapper
* WiseMapper: is a simple interface implemented by any mapper used within wise-core
requiring a single method applyMapping.
All the elements mentioned above can be combined and used to perform web service
invocation and get results. They basically support two kinds of invocation:
1. One line of code invocation: with this name we mean a near zero code invocation where
developer who have well configured Wise just have to know wsdl location, endpoint and port
name to invoke the service and get results. For a complete description and sample of this
Wise usecase please refer to paragraph 5.1.
2. Interactively explore your wsdl: Wise can support a more interactive style of
development exploring all wsdl artifact dynamically loaded. This kind of use is ideal for
an interactive interface to call the service and is by the way how we are developed our
web GUI. For a complete description and sample of this Wise usecase please refer to
paragraph 5.2.
h2. Configuration
gsfgfd
h2. Wise API usage
cgsfdg
h3. One line of code invocation
gfdgs
h3. Interactive wsdl exploration
dfsf
h2. WiseMapper: from your own object model to the generated JAX-WS model and vice versa
fdsfs
h2. Adding standard JAXWS handlers
fd
h2. Requirements and dependencies
fdfs
h2. Getting started
dsada
h3. Testsuite
dsdfsa
h3. Samples
fdsgfs
--------------------------------------------------------------
Comment by going to Community
[
https://community.jboss.org/docs/DOC-48312]
Create a new document in Wise at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=102&a...]