Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1095039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:03:43+00:00 2026-05-17T00:03:43+00:00

Am trying to invoke a public web-service using a java client but am getting

  • 0

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;

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:03:44+00:00Added an answer on May 17, 2026 at 12:03 am

    I suspect there’s a byte-order-mark in your XML response. See this SO question for further details. Capturing the response using Wireshark or similar will indicate what’s going on.

    If you do have a BOM, I suspect you can install a servlet filter to intercept the response before the webservice XML parsing code, and remove the BOM from the raw response before passing it forward.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following error when trying to use the WCF Test Client
I'm trying to invoke a spring web service, using below url in browser the
I am trying to invoke Invoke on a Dispatcher using the following overload: public
I'm currently trying to invoke a web service from a web application that I've
I'm trying to write a .Net client to a vendor's SOAP Service, but I'm
I am trying to invoke method via webservice (SOAP) I have generated Web service
I am trying to call a web service from my app. If I invoke
I am trying to invoke the method typeOfInstance() in the following (simplest) code: import
I am trying to invoke webservice using jquery ajax call. I am using jasonp
I keep getting dialogDiv.dialog is not a function. I'm simply trying to invoke the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.