webMethods Sample Java Service to concatenate two strings
Task: Concatenating the Strings to get the desired Result Few steps to follow:
-> Create a default folder structure and within the same right click new and select a JAVA service and give it a name say âdemo1â.
-> The resulting screen which gets displayed after you create the JAVA Service as shown below.
-> Include the Input and Output parameters for the JAVA service in the input/output box of the pane as shown below just as a normal flow service.
-> In the MENU BAR go to Tools ->Generate Code.
-> A pop-up window appears where click on the radio button optionâ âFor Implementing this serviceâ and click Next.
-> In the Code Generation dialog box select both the options under specification along with the All Fields option and Click the Finish button
-> On Clicking finish a pop-up will appear saying âThe generated code has been added to the clipboard. Click OK to continue.
-> Perform an action ctrl+V on the empty pane above the specification which will get you the resulting IdataCursor and pipelineCursor.
1. IdataCursor: It is the one which speaks to IData util package available in the jar files.
2. PipelineCursor: It helps in maintaining the data in the pipeline
-> Time for writing a JAVA Service: Declare the try/catch Block as any java service.
-> Initialize the result as String and include the logic for Concatenation inside the try block and save it.
-> Click on the RUN Button to execute the service after which a pop up will appear prompting for input.
-> On Clicking the OK tab, we get the result in the Results pane as shown below