Am trying to invoke a public web-service using a java client but am getting the following exception:
deserialization error: XML reader error: unexpected character content: "<?xml version="1.0" ?>
<rankedTermCandidates
xmlns="http://www.nactem.ac.uk/xsd/termine"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nactem.ac.uk/xsd/termine http://www.nactem.ac.uk/software/termine/webservice/termine.xsd"
>
Am not able to find out what I am doing wrong. Am tempted to move to a .NET client{am a c# programmer} but would like to know what I am doing wrong here.
The method calling the webservice is :
private String InvokeNactemWebService(String textToParse) throws Exception
{
String wsdlURL = "http://www.nactem.ac.uk/software/termine/webservice/termine.wsdl";
URL url = new URL(wsdlURL);
String targetNamespace = "urn:termine";
String serviceName = "termine";
String portName = "termine_porttype";
String operationName = "analyze";
QName serviceQN = new QName(targetNamespace, serviceName);
QName portQN = new QName(targetNamespace, portName);
QName operationQN = new QName(targetNamespace, operationName);
String parseResult = "";
try
{
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service service = serviceFactory.createService(url, serviceQN);
Call call = (Call) service.createCall();
call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "");
call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
call.setTargetEndpointAddress("http://www.nactem.ac.uk:9000/termine");
call.setPortTypeName(portQN);
call.setOperationName(operationQN);
call.removeAllParameters();
call.addParameter("src", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("input_format", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("output_format", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("stoplist", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("filter", XMLType.XSD_STRING, ParameterMode.IN);
Object[] inParams = new Object[] {textToParse, "", "xml", "", ""};
Object result = call.invoke(inParams);
//parseResult = (String) call.invoke(inParams);
//System.out.println(call.invoke(inParams));
return parseResult;
}
catch (Exception e)
{
e.printStackTrace();
Debug.println(e.getMessage(), e.getStackTrace().toString());
}
return parseResult;
}