Consuming Spellcheck Web Service
Hi. I am new to Java and I am trying to use a spellcheck WebService which I have found below:
http://ws.cdyne.com/SpellChecker/check.asmx?wsdl
I am trying to read back the incorrect words however I am getting the following output:
Code:
Incorrect Words: 4
Incorrect Word: org.netbeans.end2end.check.client.Words@987a33
Incorrect Word: org.netbeans.end2end.check.client.Words@7eb6e2
Incorrect Word: org.netbeans.end2end.check.client.Words@118d189
Incorrect Word: org.netbeans.end2end.check.client.Words@648016
BUILD SUCCESSFUL (total time: 3 seconds)
The code currently is this:
Code:
package spellcheckws;
import org.netbeans.end2end.check.client.DocumentSummary;
import java.util.*;
public class SpellCheck {
public static void main(String[] args) {
String textToCheck = "This is somme text which shud be cheecked by tha checker";
int incorrectCount = checkTextBodyV2(textToCheck).getMisspelledWordCount();
System.out.println("Incorrect Words: " + incorrectCount);
ListIterator li = checkTextBodyV2(textToCheck).getMisspelledWord().listIterator();
while (li.hasNext()) {
System.out.println("Incorrect Word: " + li.next());
}
}
private static DocumentSummary checkTextBodyV2(java.lang.String bodyText) {
org.netbeans.end2end.check.client.Check service = new org.netbeans.end2end.check.client.Check();
org.netbeans.end2end.check.client.CheckSoap port = service.getCheckSoap();
return port.checkTextBodyV2(bodyText);
}
}
Can anyone help me identify what is the problem? Also how can I display the word recommendations?
Thanks!