Click here to Skip to main content
15,114,127 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I am trying to receive an XML parameter, through Rest WCF request. my input xml node is this:
<RequestData  xmlns='RequestXML'>
    <group>Category Penetration - Overall</group>
    <filter>Total Sample</filter>

It is read into a class :
[DataContract(Namespace = "RequestXML")]
public class RequestData
       public string market { get; set; }
       public string gender { get; set; }
       public string stattype { get; set; }
       public string section { get; set; }
       public string viewoption { get; set; }
       public string mission { get; set; }
       public string group { get; set; }
       public string filter { get; set; }
       public string chartmode { get; set; }
       public string viewpage { get; set; }
       public string samplefilter { get; set; }


Now when I read this request, few parameters are received and few are not. eg: parameters : market,stattype,viewpage are always received where as rest of them are always null.

Here is the interface

       //attribute for returning JSON format
       [WebInvoke(Method = "POST",
           ResponseFormat = WebMessageFormat.Json,
           RequestFormat= WebMessageFormat.Xml,
           BodyStyle = WebMessageBodyStyle.WrappedResponse,
           UriTemplate = "ProfileData")]
       List<ProfileData> GenProfileData(RequestData xmlRequestString);

I hope my questions is clear. Hoping for a quick response
Updated 6-Nov-14 6:38am

1 solution

I would suggest you to use Fiddler[^] or even IE developer toolbar to check if what xml values are being sent to the web service.

Then you can be atleast sure that the correct data is sent and there is not issue with the request itself.

If this correct, next step would be to use Visual Studio and debug what do you receive on the web server and step into the constructor (or method). I hope by now, you should already see what's going wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900