Interfaces are very important feature in Conceptwave to
interact with external systems from CW.
Interfaces works in concept of Webservices. We have to
build a webservice to connect to external system by defining request and
response data structures.
Creating
an Interface
Open Interfaces perspective from designer and create a
new name space with required name say empService.
Suppose input elements are empId, empDepartment to get
employee details then we have create one request data structure with empId and
empDepartment by specifying required data type.
Next we have to create response data structure. Suppose
if our response type is JSON and structure is like below
empService{
empDetails{
empId: “12345”,
empName: “Test”,
empDesignation: “Professional”,
empSal:10000
}
}
We have to create a data structure empService and under
to it empDetails and under to it, define the fields with required datatypes.
After this we have create external service under Metadata
object and Bind Service and Port configurations. We have to specify what the
response type like XML, text is or JSON as we are using REST based webservice
which supports all the other formats apart from XML (SOAP supports only XML).
We have to specify what is our request type and response
type and their data structures in bind services etc.
After completion of all these creations, we have to build
this service to a Jar file by using Build JAR from Conceptwave design studio.
Now we have a jar like empService.jar which we have to
place it in library files and templates of our metadata and specify this new
jar details in headerMetadata file which will read all our metadata objects and
load those into our designer studio.
Configuring
a Service
After jar configurations, we have to specify the endpoint
URL to hit the service for response retrieval. This will be done in config mode
(say http://localhost:8081/cwf/config)
and locate to empServie under Services tab and provide the endpoint URL over there like http://empService:8082/getEmpDetails
No comments:
Post a Comment