私は初心者です。Plzzはこれで私を助けます。WCF Restアプリケーションでは、次の応答が必要です
<parameterList>
<parameter>
<Question> Occupation </Question>
<Choice> Student/Others </Choice>
<Choice> Retired/housewife </Choice>
<Choice> Salaried/SelfEmployed </Choice>
<Choice> Doctor/CA/Socially Important Person </Choice>
</parameter>
</parameterList>
内容の異なる4つの同じ「選択」タグが必要です。私が得ているのは、最後の「選択」タグだけです。
IService.cs
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "/getQuestion")]
[return: MessageParameter(Name = "parameterList")]
List<parameter> getQuestion();
Service.svc.cs
public List<parameter> getQuestion()
{
List<parameter> lstParameter = new List<parameter>();
parameter param = new parameter();
param.Question = " Occupation ";
param.Choice = " Student/Others ";
param.Choice = " Retired/housewife ";
param.Choice = " Salaried/SelfEmployed ";
param.Choice = " Doctor/CA/Socially Important Person ";
lstParameter.Add(param);
return lstParameter;
}
parameter.cs
public class parameter
{
public string Question
{
get{ } set{ }
}
public string Choice
{
get{ } set{ }
}
}