// Service file
[WebInvoke(UriTemplate = "Send/{country}", Method = "POST")]
public int Send(IFoo item, string country)
// Interface file
public interface IFoo
{
string firstMember { get; set; }
string secondMember { get; set; }
}
// Implementation file
public class FooImpl : IFoo
{
string specificMember { get; set; }
}
http://example.com/MyService/Send/ {COUNTRY}/に投稿してRESTサービスを呼び出し
ます。次のようなtext/xmlパラメーターとしてIFoo実装を提供できるようにしたいです。
<FooImpl xmlns="http://schemas.datacontract.org/2004/07/Hello">
<firstMember>Hello</firstMember>
<secondMember>World</secondMember>
<SpecificMember>!</SpecificMember>
</FooImpl>
Sendメソッド宣言でFooImpl型を宣言すると機能しますが、IFoo型を使用すると機能しません。(エラー400:不正な要求)
サービスヘルパーは次のように表示します:
<anyType xmlns:d1="http://www.w3.org/2001/XMLSchema" i:type="d1:schema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" />
だから、それが私のパラメータのxmlの問題なのか、実装の問題なのかわかりません...