webMethods Sample Java Service to concatenate two strings
Aug 04, 2014 15:53 0 Comments WebMethods Neelima

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”.


alt


-> The resulting screen which gets displayed after you create the JAVA Service as shown below.



alt



-> 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.


alt


-> In the MENU BAR go to Tools ->Generate Code.


alt

-> A pop-up window appears where click on the radio button option→ “For Implementing this service” and click Next.


alt


-> In the Code Generation dialog box select both the options under specification along with the All Fields option and Click the Finish button


alt


-> On Clicking finish a pop-up will appear saying “The generated code has been added to the clipboard. Click OK to continue.


alt



 -> 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




alt

 




 

-> Time for writing a JAVA Service: Declare the try/catch Block as any java service.



alt



-> Initialize the result as String and include the logic for Concatenation inside the try block and save it.


alt


 

-> Click on the RUN Button to execute the service after which a pop up will appear prompting for input.


alt


-> On Clicking the OK tab, we get the result in the Results pane as shown below

alt

 

Prev Next
About the Author
Topic Replies (0)
Leave a Reply
Guest User

You might also like

Not sure what solution is right for you?

Choose the right one for you.
Get the help of the experts and find a solution that best suits your needs.


Let`s Connect