How to check String is Palindrome or not Using WebMethods

211 views Asked by At

I want to check given string palindrome or not and I want to write the logic in WebMethods, Is anyone help me on this, because I am new in the WebMethods..

1

There are 1 answers

2
Michael Knoth On

I would recommend you to write a Java service, with a Webmethods Flow this will be rather painful and not good for performance. In a Webmethods Java service you can use the same libraries as in a normal Java application

First Step, Create a Java service First Step, Create a Java service

Define in- and output Define in- and output

Than you get the input in java

IDataMap map = new IDataMap(pipeline);
String stringToCheck = map.getAsString("stringToCheck");

Now its your turn to implement the logic to check for palindrome, you can simply use the put Method from the IDataMap Class to define the service output

map.put("isPalindrome", palindromeCheckResult);