I have gone through much articles and questions but I am unable to resolve my problem. I am new to Fiddler and don't know how to use it. I want to pass List ob objects as an input in my WCF REST Service.
Here is my Service Interface:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "LeadStage",
ResponseFormat = WebMessageFormat.Xml,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare)]
Result AddLeadStage(ReqLeadStage[] rls);
This is my ReqLeadStage class.
public class ReqLeadStage
{
public string Id { get; set; }
public string Name { get; set; }
public string Comments_Remarks__c { get; set; }
public string Entry_Point__c { get; set; }
public string Exit_Point__c { get; set; }
public string IsActive { get; set; }
public string Sequence_No__c { get; set; }
public string Stage_Description__c { get; set; }
public string CreatedById { get; set; }
public string CreatedDate { get; set; }
public string LastModifiedById { get; set; }
public string LastModifiedDate { get; set; }
}
And this is my Web.Config
<system.serviceModel>
<services>
<service name="SalesForceWCF.SalesForce" behaviorConfiguration="">
<endpoint address="" behaviorConfiguration="RESTBehavior"
binding="webHttpBinding" contract="SalesForceWCF.ISalesForce"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="RESTBehavior">
<webHttp helpEnabled="true"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
And this is my Result class:
[DataContract]
public class Result
{
[DataMember]
public int CODE { get; set; }
[DataMember]
public string STATUS { get; set; }
[DataMember]
public string DESCRIPTION { get; set; }
}
Here is how I ma calling it from Fiddler:
And JSON:
[ { "attributes" : { "type" : "Lead_Stage__c", "url" : "/services/data/v29.0/sobjects/Lead_Stage__c/a009000000Rmb3wAAB" }, "Name" : "Discovery", "LastModifiedById" : "005900000028VWrAAM", "CreatedById" : "005900000028VWrAAM", "CreatedDate" : "2013-12-23T10:22:48.000+0000", "LastModifiedDate" : "2013-12-23T10:22:48.000+0000", "Id" : "a009000000Rmb3wAAB" }, ...... ]
This is a complete picture How I am sending my Request!
And this is the error:
400 Bad Request Error. I am not able to trace it.
Thanks!