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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:59:35+00:00 2026-06-16T00:59:35+00:00

I have made Restfull WS in VS 2010 with two simple method (one GET,

  • 0

I have made Restfull WS in VS 2010 with two simple method (one GET, another POST). They look like:

[ServiceContract]
public interface IService1
    {

    [OperationContract]
    [WebInvoke(Method = "POST", UriTemplate = "createUser")]
    string createUser();

    [OperationContract]
    [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, UriTemplate = "loginUser/{email}/{password}")]
    string loginUser(string email, string password);

    }

Definition of these methods is simple:

public class Service1 : IService1
    {

 public string createUser()
        {
            return "Successful POST call !!! ";
        }

 public string loginUser(string email, string password)
        {
            return "Successful GET call !!! " + email + " - "+ password;
        }
  }

I have published this service to IIS and tested my method in browser (only loginUser (GET) method, cannot test createUser (POST) method by the browser) and method (loginUser ) work fine.
When I tried to call method by jQuery AJAX, I am always getting error call without any notification. I checked my fiddler and there are the right response.

My Ajax method:

$(document).ready(function(){

$("#button2").click(function(){

  $.ajax({
   type: "GET",                 
   url: "http://localhost/AutoOglasi/Service1.svc/loginUser/bole/bole",

   success: function (response) {
    alert("respons  "+response);
   },
       error: function (request, status, error) {
    alert(request.responseText+" -- " + status + " --- "+ error);
   }
     });                

});

});

I mozila firebug i section XML I get this:

XML Parsing Error: no element found Location: moz-nullprincipal:{ba25ef4a-f215-486e-b965-e70714c5af31} Line Number 1, Column 1:
^

What I am doing wrong here, I just cannot figure out, because fiddler is giving me good response?

  • 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-06-16T00:59:36+00:00Added an answer on June 16, 2026 at 12:59 am

    You state ResponseFormat = WebMessageFormat.XmlResponseFormat and what you return is not xml but a string. It expects the first character to be a < but its a S thats why its not finding an element at position 1

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

Sidebar

Related Questions

I have made an iphone application like flip cards in which values of cards
I have made a Highcharts chart with grouped and stacked columns, like in the
I have made a simple form with a yes and a no checkbox for
I have made a jQuery toggle for a menu that I had in mind.
I have made an application for IPad in objective C. In this I am
i have made an application having entity framewrok. It is wpf application, now it
I have made a code that read data from flash Nand (without filesystem). fd
I have made a cart and the cart has remove item button, but the
I have made a website using( Asp.net, c# ) and its content in English
I have made a map of functions. all these functions are void and receive

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.