私は持っている
[OperationContract]
[WebInvoke(Method = "POST",
ResponseFormat = WebMessageFormat.Xml,
RequestFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Bare,
UriTemplate = "projects/{projectname}")]
[return: MessageParameter(Name = "ProjectId")]
Guid CreateProject(String projectName);
しかし、これはまだ戻ります
<guid
xmlns="http://schemas.microsoft.com/2003/10/Serialization/">00000000-0000-0000-0000-00000000</guid>
「guid」を ProjectId に置き換えるにはどうすればよいですか?
public Guid CreateProject(String projectName)
{
return Guid.Empty;
}
OperationContract BodyStyle を次のように変更すると、次のようWrappedResponse
になります。
<CreateProjectResponse
xmlns="http://tempuri.org/">
<ProjectId>00000000-0000-0000-0000-000000000</ProjectId>
</CreateProjectResponse>
これはほとんど私が望むものですが、不必要にラップしたくありません.