私はこれを何度もやった気がしますが、あまりにも多くのフープをジャンプしなければならないようで、もっと簡単な方法があるかどうか疑問に思っています.
WCF を使用して API (REST および SOAP エンドポイント) を構築しています。私は自分の呼び出しの 1 つから XML 応答をどのように表示したいかを構築しています。同等のオブジェクト モデル (データ コントラクト) を取得する最も簡単な方法を知りたいです。
GetSectionInvitesResponse が API 呼び出しから返される最上位コントラクトであるサンプル XML 要求を次に示します。
<GetSectionInvitesResponse>
<UserID></UserID>
<OrganizationInvites>
<SectionInvites>
<SectionSubscriber>
<Section>
<ID></ID>
<Name></Name>
<Description></Description>
<Descriptor></Descriptor>
<ParentID></ParentID>
</Section>
<SectionSubscriberID>
</SectionSubscriber>
<SectionSubscriber>
<Section>
<ID></ID>
<Name></Name>
<Description></Description>
<Descriptor></Descriptor>
<ParentID></ParentID>
</Section>
<SectionSubscriberID>
</SectionSubscriber>
</SectionInvites>
</OrganizationInvites>
<OrganizationInvites>
<SectionInvites>
<SectionSubscriber>
<Section>
<ID></ID>
<Name></Name>
<Description></Description>
<Descriptor></Descriptor>
<ParentID></ParentID>
</Section>
<SectionSubscriberID>
</SectionSubscriber>
<SectionSubscriber>
<Section>
<ID></ID>
<Name></Name>
<Description></Description>
<Descriptor></Descriptor>
<ParentID></ParentID>
</Section>
<SectionSubscriberID>
</SectionSubscriber>
<SectionSubscriber>
<Section>
<ID></ID>
<Name></Name>
<Description></Description>
<Descriptor></Descriptor>
<ParentID></ParentID>
</Section>
<SectionSubscriberID>
</SectionSubscriber>
</SectionInvites>
</OrganizationInvites>
</GetSectionInvitesResponse>
編集 最初の投稿では十分に明確ではなかったので、この質問から何を得ようとしているのかをより明確にしたいと思います。
上記と同じ XML スキーマに従いながら、最小限の重複コードで SOAP および REST を介してこれを公開する最良の方法を知りたいですか?