This is a migrated thread and some comments may be shown as answers.

Sending multiple parameters to REST service created with wizard using POST

1 Answer 192 Views
Web Services
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Awni
Top achievements
Rank 1
Awni asked on 12 Apr 2012, 05:27 PM
Sending multiple parameters to REST service created with wizard using POST   


Hello, 
I used the wizard to generate a WCF REST service, and the following is one of the generated methods. 
I am trying to call this method, but not sure how to sending multiple parameters. I am testing with fiddler.
Here is a Call object that I have successfully sent to the OnAddItem(also generated by the wizard):

{"AccountId":"2012328001","CallCreated":"\/Date(1334214000000-0700)\/","CallStatus":"AC","CarNumber":"","CustomerName":"not AMANDA","CustomerPhone":"941.302.8611","DropoffAddress":"home","DropoffCity":"sarasotta","DropoffDate":"\/Date(00000-000)\/","DropoffState":"fl","DropoffZIP":"88449","Fare":-1,"Id":"2933","MilesDriven":-1,"PickupAddress":"55 north Madison st","PickupCity":"sarasotta","PickupDate":"\/Date(00-000)\/","PickupState":"FL","PickupZIP":"88333","Rate":0,"TravelTime":"0:00","TravelTimeTimeSpan":-1}

protected DispatchOADomainModel.Call OnUpdateItem(string id, DispatchOADomainModel.Call newValue)
        {
            try
            {
                this.dataManager.UpdateEntity(newValue);
                return newValue;
            }
            catch (OpenAccessException)
            {
                throw new Exception(Convert.ToString(HttpStatusCode.BadRequest));
            }
        }


How can I send the 2 paramters: id and newValue using POST method?

Thank you in advance,
awni

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 17 Apr 2012, 12:52 PM
Hi Awni,

 Can you try passing the Id parameter in the query string of the URI that you are sending the Http POST request to. The URI should contains something like: http://localhost/yourrestserviece/updatecalls?id=3. 


Kind regards,
Zoran
the Telerik team
Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
Tags
Web Services
Asked by
Awni
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or