0

sharepoint でドキュメントのコンテンツを読み取ろうとしており、cellstorage.csv/CellStorageService という名前の Web サービスを再利用しています。

応答は、1 つの XML 部分と 1 つのバイナリー部分を含むマルチパートです。

バイナリ部分を読みたいです。

コンテンツ タイプは次のとおりです。

Content-Type: multipart/related; type="application/xop+xml"; boundary="urn:uuid:a192024b-547a-584b-a56c-b05f25c22fdf"; start="<1c830af4-214f-1c4b-8a71-6269053e3161@tempuri.org>"; start-Info="text/xml; charset=utf-8"

返される内容は次のとおりです。

--uuid:acf0b1de-4e59-4304-ba6e-23a7a4e2a9cc+id=1
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>
<ResponseVersion Version="2" MinorVersion="3" 
xmlns="http://schemas.microsoft.com/sharepoint/soap/"/><ResponseCollection 
WebUrl="

...
></SubResponse></Response></ResponseCollection></s:Body></s:Envelope>

--uuid:acf0b1de-4e59-4304-ba6e-23a7a4e2a9cc+id=1
Content-ID: <http://tempuri.org/1/636403683925268534>
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

このプロジェクトでは既に MimeKit を使用しているため、これを Mimekit にロードして解析できるようにしました。

           ContentType contentType1 = ContentType.Parse("application/xop+xml");
            MimeEntity entity1 = MimeEntity.Load(contentType1, new MemoryStream(bytes));

            ContentType contentType = ContentType.Parse("application/octet-stream");
            MimeEntity entity = MimeEntity.Load(contentType, new MemoryStream(bytes));

            MimeParser parser = new MimeParser(new MemoryStream(bytes), MimeFormat.Entity);
            //var message = parser.ParseMessage();
            var entity3 = parser.ParseEntity();

デバッガーで結果を見ると、3 つのエンティティ (entiy、entity1、entity3) はすべて同じように見え、xml コンテンツのみが解析されているようです。

バイナリ部分を取得できません。

このタイプのコンテンツを解析するために MimeKit を使用できるかどうか、およびこれを正しく解析できているかどうかを教えてください。

どうもありがとう

ジル

4

1 に答える 1