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 725339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:19:33+00:00 2026-05-14T06:19:33+00:00

im trying to use the jQuery UI autocomplete to communitate with a webservice with

  • 0

im trying to use the jQuery UI autocomplete to communitate with a webservice with responseformate JSON, but i am unable to do so.

My webservice is not even executed, the path should be correct since the error message does not complain about this.

What strikes me is the headers, response is soap but request is json, is it supposed to be like this?

Response Headersvisa källkod
Content-Type application/soap+xml; charset=utf-8


Request Headersvisa källkod
Accept application/json, text/javascript, */*
Content-Type application/json; charset=utf-8

The error message i get is as follows (sorry for the huge message, but it might be of importance):

soap:ReceiverSystem.Web.Services.Protocols.SoapException: Server was unable to process request. —> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()
at System.Xml.XmlReader.MoveToContent()
at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()
at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()
at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
— End of inner exception stack trace —

This is my code:

$('selector').autocomplete({   
   source: function(request, response) {
                $.ajax({
                    url: "../WebService/Member.asmx",
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    type: "POST",
                    data: JSON.stringify({prefixText: request.term}),

                    success: function(data) {
                        alert('success');
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown){
                        alert('error');
                    }
                })
                }, 
   minLength: 1,
   select: function(event, ui) {

   }
  });

And my webservice looks like this:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[ScriptService]
public class Member : WebService
{

    [WebMethod(EnableSession = true)]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
    public string[] GetMembers(string prefixText)
    {
       code code code
    }

}

What am i doing wrong? Thanks in advance 🙂

  • 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-14T06:19:34+00:00Added an answer on May 14, 2026 at 6:19 am

    I believe you need to include the name of the method to your URL:

    /WebService/Member.asmx/GetMembers

    When using a webservice I always like to set the path to the root (/ no ../), it can be helpful if you are doing any kind of URL rewrites or using routing.

    Here is a good blog post to read in regards to calling a webservice from JQuery. http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/

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

Sidebar

Related Questions

I'm trying to use JQuery's autocomplete plug-in but for some reasons Internet Explorer is
I'm trying to use the new autocomplete function in jQuery UI, but I'm having
I am trying to use jQuery's fancy autocomplete function but I have a problem
I am trying to use the jquery autocomplete plugin but am having trouble getting
I am trying to use autocomplete from http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js but am getting this error. textbox
I'm trying to use the JQuery Autocomplete, but I guess I am having trouble
I am trying to use Django with jquery UI autocomplete but having trouble sending
I am trying to use jquery autocomplete plugin, I want it to suggest ItemCodes
I'm trying to use the Jquery UI Autocomplete to retrieve synonyms for any word
I'm trying to use the autocomplete plugin for jQuery (this one http://docs.jquery.com/Plugins/Autocomplete ). My

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.