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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:43:06+00:00 2026-05-15T04:43:06+00:00

I’m trying to send data from a client application using jQuery to a REST

  • 0

I’m trying to send data from a client application using jQuery to a REST WCF service based on the WCF REST starter kit.

Here’s what I have so far.

Service Definition:

[WebHelp(Comment = "Save PropertyValues to the database")]        
[WebInvoke(Method = "POST", UriTemplate = "PropertyValues_Save",
           BodyStyle = WebMessageBodyStyle.WrappedRequest,
           RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
public bool PropertyValues_Save(Guid assetId,
                                Dictionary<Guid, string> newValues) {
            // ...
}

Call from the client:

$.ajax({
     url:SVC_PROPERTYVALUES_SAVE,
     type: "POST",
     contentType: "application/json; charset=utf-8",
     data: jsonData,
     dataType: "json",
    error: function(XMLHttpRequest, textStatus, errorThrown) {
     alert(textStatus + ' ' + errorThrown);
      },
     success: function(data) {
      if (data)  {
       alert('Values saved'); $("#confirmSubmit").dialog('close'); 
      }
      else {
       alert('Values failed to save'); $("#confirmSubmit").dialog('close');
      }      
     }
    });

Example of the JSON being passed:

{
    "assetId": "d70714c3-e403-4cc5-b8a9-9713d05b2ee0",
    "newValues": [
        {
            "key": "bd01aa88-b48d-47c7-8d3f-eadf47a46680",
            "value": "0e9fdf34-2d12-4639-8d70-19b88e753ab1" 
        },
        {
            "key": "06e8eda2-a004-450e-90ab-64df357013cf",
            "value": "1d490aec-f40e-47d5-865c-07fe9624f955" 
        } 
    ] 
}

web.config

<?xml version="1.0"?>
<configuration>

     <configSections>

          <sectionGroup name="applicationSettings"
                        type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

          </sectionGroup>

     </configSections>

 <system.web>
  <compilation debug="true"/>
        </system.web>
 <system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
 </system.serviceModel>

     <appSettings>

         ...

     </appSettings>

</configuration>

I’m using Windows Authentication on the virtual directory and anonymous access is disabled. When I call operations that are GETs, everything is fine. This code is prompting the browser to log in. When I enter my credentials, I simply get an alert in my browser which says “error undefined”.

Even if you can’t help my specific error, do you see anything that looks wrong from glancing?

I’ve been beating my head on this nearly all day.

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-15T04:43:07+00:00Added an answer on May 15, 2026 at 4:43 am

    If you have authentication problems it can be important to verify that only “Windows Authentication” is switches on and “Anonymous” access is switches of in your virtual directory.

    If you do have no problem with irtual directory your should post the code of your web.config file.

    From your question it stay not clear for me whether you have only authentication problems or the PropertyValues_Save will be not called with the JSON data which you posted. Could you formulate more clear this?

    UPDATED: It seems to me that your program will work if the JavaScript client will use “Key” and “Value” property names instead of “key” and “value”.

    I recommend you also look at the end on my old answer How do I build a JSON object to send to an AJAX WebService? to verify, that you pack the data correct for the call of server.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.