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

  • Home
  • SEARCH
  • 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 6956391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:51:48+00:00 2026-05-27T14:51:48+00:00

Hi all i am using json to pass data in wcf service. Below is

  • 0

Hi all i am using json to pass data in wcf service. Below is my code. I am able to pass data ProjectCollection

But i want to pass data as an array like this

var ProjectCollection = [‘new’,’test’,’etc’];

var ProjectCollection = "Test";      
  function GetEmployee() {
        Type = "GET";
        Url = "http://localhost:52136/Service1.svc/GetTimesheetEntries";
        DataType = "jsonp";
        Data = {vb: ProjectCollection,vb1: '1'};
        ProcessData = false;
        method = "GetTimesheetEntries";
        CallService();
    }

 function CallService() {
        $.ajax({
            type: Type, //GET or POST or PUT or DELETE verb
            url: Url, // Location of the service
            data: Data, //Data sent to server
            contentType: ContentType, // content type sent to server
            dataType: DataType, //Expected data format from server
            processdata: ProcessData, //True or False
            success: function (msg) {//On Successfull service call
                ServiceSucceeded(msg);
            },
            error: ServiceFailed// When Service call fails
        });
    }

This is my webservice function. So my requirement is to get all array data from json to this function argument.

 public List<WcfService1.Customer> GetTimesheetEntries(string[] vb , string vb1)
    {
        DataClasses1DataContext i = new DataClasses1DataContext();
        //var b = from vb in i.TimeSheetMasters select vb;
        //return b.ToList();

        var list = from time in i.TimeSheetMasters
                   join activity in i.ProjectMasters
                   on time.ProjectId equals activity.ProjectId
                   join res in i.ResourceMasters on time.ResourceId equals res.ResourceId
                   where time.TaskDetails == vb && time.BookHours == vb1
                   select new WcfService1.Customer
                   {
                       RName = res.ResourceName,
                       PName = activity.ProjectTitle
                   };

        return list.ToList();


    }
  • 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-27T14:51:49+00:00Added an answer on May 27, 2026 at 2:51 pm

    I Found my Solution

      function GetTimeSheet() {
        //webserviceurl[2]
        Type = "GET";
        Url = "http://gtsp12:3030/Service1.svc/GetTimesheetEntries";
        DataType = "jsonp";
        Data = { Projects: JSON.stringify(projectlist), Resources: JSON.stringify(Resourcelist) };
        method = "GetTimesheetEntries";
        CallService1();
    }
    

    Just create array in your script. Initialize it and pass as an argument in webservice like above.

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

Sidebar

Related Questions

I'm using all of the below to take a field called 'code' from my
i pass Json String from my WebService to My code Using NSDictionary -(void)getData :(NSData*)respo{
I am using GSON to parse a Java bean and pass the JSON string
I'm using Jersey to build a REST API to a service. I'd like to
I have an extremely simple JSON object that looks like the following: var data
Im just starting to get the hang of using json and Id like to
I'm new to JSON and have been using it with MVC3 ASP.NET but could
I've a ScriptTagProxy and I'm able to receive the data, but now I wanted
Given optimistic concurrency using a version property and a json rest-service with a client
I am using Ext.data.Store to call a PHP script which returns a JSON response

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.