4

基本的に私がやろうとしているのは、ドキュメント アップローダ マネージャに電子メールを送信するワークフロー ( sharepoint 2013for ) を作成することです。o365

そのために、VS 2012マネージャーのログインを抽出したい場所から、アップローダー プロファイルを返すカスタム アクティビティを作成しました。

私はそのHttpSendアクションと次のRESTサービスに使用しています:

uri + "_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='" + Login + "'"

応答は問題ありません - 私はそれをフィドラーでインターセプトし、任意のもので解析できますJSON parser(フィドラーへの組み込みを含む)

{"d":{"__metadata":         {"id":"http://sp13dev/sites/dev/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)","uri":"http://sp13dev/sites/dev/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)","type":"SP.UserProfiles.PersonProperties"},"AccountName":"MVO\\mvogelsi","DirectReports":{"results":[]},"DisplayName":"Marcin Vogelsinger","Email":null,"ExtendedManagers":{"results":["MVO\\rmakowsk"]},"ExtendedReports":{"results":["MVO\\mvogelsi"]},"IsFollowed":false,"LatestPost":null,"Peers":{"results":["MVO\\tbiolo"]},"PersonalUrl":"http://sp13dev/my/Person.aspx?accountname=MVO%5Cmvogelsi","PictureUrl":null,"Title":null,"UserProfileProperties":   {"results":[{"__metadata":{"type":"SP.KeyValue"},"Key":"UserProfile_GUID","Value":"b3d09b4d-0d7e-45be-a3d9-b9f23a972e9c","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SID","Value":"S-1-5-21-28665521-4166225307-422210891-1000","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"ADGuid","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"AccountName","Value":"MVO\\mvogelsi","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"FirstName","Value":"Marcin","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PhoneticFirstName","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"LastName","Value":"Vogelsinger","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PhoneticLastName","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"PreferredName","Value":"Marcin Vogelsinger","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PhoneticDisplayName","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"WorkPhone","Value":"888265520","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"Department","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"Title","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-JobTitle","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Department","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"Manager","Value":"MVO\\rmakowsk","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"AboutMe","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"PersonalSpace","Value":"SPSSITEERROR","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"PictureURL","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"UserName","Value":"mvogelsi","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"QuickLinks","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"WebSite","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"PublicSiteRedirect","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Dotted-line","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Peers","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Responsibility","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-SipAddress","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-MySiteUpgrade","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ProxyAddresses","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-HireDate","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-DisplayOrder","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ClaimID","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ClaimProviderID","Value":"Windows","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ClaimProviderType","Value":"Windows","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-SavedAccountName","Value":"MVO\\mvogelsi","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-SavedSID","Value":"System.Byte[]","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ResourceSID","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ResourceAccountName","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-ObjectExists","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-MasterAccountName","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-UserPrincipalName","Value":"mvogelsi@mvo.dom","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PersonalSiteCapabilities","Value":"0","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-O15FirstRunExperience","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PersonalSiteInstantiationState","Value":"8197","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-DistinguishedName","Value":"CN=Marcin Vogelsinger,CN=Users,DC=mvo,DC=dom","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-SourceObjectDN","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-FeedIdentifier","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"WorkEmail","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"CellPhone","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"Fax","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"HomePhone","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"Office","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Location","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"Assistant","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PastProjects","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Skills","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-School","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Birthday","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-StatusNotes","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-Interests","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-HashTags","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-EmailOptin","Value":"","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PrivacyPeople","Value":"False","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-PrivacyActivity","Value":"0","ValueType":"Edm.String"},{"__metadata":{"type":"SP.KeyValue"},"Key":"SPS-TimeZone","Value":"","ValueType":"Edm.String"}]},"UserUrl":"http://sp13dev:80/my/Person.aspx?accountname=MVO%5Cmvogelsi"}}

このカスタム アクティビティは、sp designer 2013 で作成され、私の開発環境に展開された単純なワークフロー内で使用されました。ただし、ワークフローを起動しようとすると、キャンセルされ、次のエラーが表示されます。

Details: System.IO.InvalidDataException: Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', Received ContentType : 'application/json'. Content (truncated) : '{"d":{"__metadata":{"id":"http://sp13dev/sites/dev/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)","uri":"http://sp13dev [here goes the rest of JSON which is already available above]

o365用なので、宣言的な方法で行く必要があります。

誰もそのような問題に遭遇しましたか?

4

1 に答える 1

0

過去に同様の問題に直面したことがあり、同じ問題を解決するのに役立つブログに出くわしました

この問題の理由は、SharePoint REST からの既定の応答が XML であり、SharePoint デザイナー ワークフローが xml を解析できず、JSON 応答が必要であるためです。この問題を解決するには、Accept と Content-Type を application/json;odata=verbose としてリクエスト ヘッダーに渡す必要があります。このようにして、JSON 応答を取得します。

https://prasadpathak.wordpress.com/tag/expected-content-type-applicationjson/

上記のブログに記載されている手順を試してください。

于 2015-06-18T07:05:01.470 に答える