Jun
22
2010

Calling a webservice inside JCaps 6

Assume we have a webservice. The first thing to do is to get a copy of the WSDL file of the service. Then inside Netbeans:

CAPS project context menu

Select “File system” and click “Next >”. Locate the WSDL, and accept all default settings by clicking through the whole wizzard. The result:

Imported WSDL and XSD from service

Implementation

Next, create a new Collaboration Definition (JCD) inside the project. We want to initialize the JCD with a Queue message. So the input will be a JMS operation. For the output parameter look up the newly imported WSDL definition.

After creating the JCD, open it and look for the WSDL definition inside the mapping editor. Look for the PortType node. Rightclick the node :

Mapping context menu

Next an object browser window opens :

Class browser

If the service needs input, we first have to fill all input objects, and after that call the invoke() like this (inside the code view):

JCD java code

Configuration

Create an environment inside the services tab of Netbeans with a logical host for catching message queue’s, and pointing to the right integration server. For calling the webservice we create an extra ‘SOAP / HTTP Webservice external system’.

configuration context menu

Rightclick on the external system icon for the service, and click the ‘configuration’ menu:

Fill in the webservice reference

It is also possible to store all above configuration data inside LDAP, and fill ldap://…. references inside the external engine configuration. After finishing the environment, create a connectivity map, drag and drop the JCD inside. Generate the mappings. Create a deployment profile and build the system.

posted in GlassFish, GlassFish ESB, Netbeans by Steve Liem

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Leave Your Comment

 


Copyright


Yenlo is de ICT dienstverlener in Nederland die volop Sun Glassfish technologie inzet om SOA en ESB projecten te doen slagen.
Voor meer informatie kijk ook op www.yenlo.nl

Glassfish is an official trademark of Sun's solution for Application Servers and SOA/BPEL/ESB middleware.
For more information, please see Sun's official website, http://www.sun.com/software/products/appsrvr