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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:35:03+00:00 2026-06-13T06:35:03+00:00

I want to call a web service that returns JSON object, the web service

  • 0

I want to call a web service that returns JSON object, the web service specification is as mentioned in the following link:

http://dev.joget.org/community/display/KB/JSON+API#JSONAPI-web%2Fjson%2Fworkflow%2Fpackage%2Flist

I have a simple view inside my asp.net mvc3 web application as follows:

@{
    ViewBag.Title = "Home Page";
}
   <script src="@Url.Content("~/Scripts/f.js")" type="text/javascript"></script>


<h2>@ViewBag.Message</h2>
<p>
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
</p>
<h1>The Processes are </h1>

<ul id="products"/>

and the following f.js to call the web service and display the returned JSON data:

$(document).ready(function() {
    $.ajax({
        type: 'GET',
        url: 'http://localhost:8080/jw/web/json/workflow/package/list?loginAs=admin',
        dataType: 'json',
        success: function(data) {
            $.each(data, function(key, val) {
                alert("jsonData");
                // Format the text to display.
                var str = val.packageId + ': $' + val.packageName;

                // Add a list item for the product.
                $('<li/>', {
                    text: str
                }).appendTo($('#products'));

            });
        }
    });
});​

But the problem is that when I navigate to the view nothing will be displayed on the view as a result of the AJAX call, bearing in mind that if I manually type the URL: ‘http://localhost:8080/jw/web/json/workflow/package/list?loginAs=admin&#8217; in the address-bar of my browser then the results will be displayed inside the browser successfully?

So what might be going wrong?

:::UPDATED:::

I updated my JavaScript to the following:

$(document).ready(function() {
    $.ajax({
        type: "GET",
        url: "http://localhost:8080/jw/web/json/workflow/package/list?loginAs=admin",
        dataType: "JSONP",
        contentType: "application/json; charset=utf-8",
        success: function(data) {
            $.each(data, function(key, val) {

                // Format the text to display.
                var str = val.packageId + ': $ ' + val.packageName;

                // Add a list item for the product.
                $('<li/>', {
                    text: str
                }).appendTo($('#products'));

            });
        }
    });
});​

but the result of the web service call is returned as:

- undefined: $ undefined

instead of being:

 {"activityId":"","processId":"289_process1"}

So what is the problem that is preventing my code from displaying the right data?

  • 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-13T06:35:04+00:00Added an answer on June 13, 2026 at 6:35 am

    I modify my JavaScript code to the following:-

    //code goes here
    success: function(result) {
    $.each(result.data, function(key, val) {
    
    //code goes here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Apache http classes to call a web service that returns a
I have a web-service that returns a custom object, but now I want to
I want to call a web service that requires an authentication cookie. I have
I have a web service that wish to call, and I want to pass
I have a web service call that returns XML which I convert into domain
I have to call a rest web service that returns a large amount of
We want to track the time taken by a web service call between a
I am new to titanium and and want to call a web service from
I want to use jQuery to make a call to a c# web service
I have written an application that queries a web service I wrote (which returns

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.