<\/HEAD>
Snažím se získat token pro ArcGIS Online pomocí c# (no, přesněji SSIS). Mám url, kterou mohu použít a která funguje dobře, a mohu ji otevřít a získat, co potřebuji v Chrome, ale nefunguje to přes c# pomocí WebClient.<\/P>
<\/P>
Mohu získat jiné jsony přes SSIS\/C# WebClient, ale z nějakého důvodu NE ArcGIS Online. Url funguje přes Chrome, ale nepřinese odpověď přes SSIS\/C# WebClient.<\/P>
Můj kód (s client id\/secret\/credentials) je:<\/P>
<SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: 13px;">string<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> webResource <\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">=<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> <\/SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px;">"https:\/\/mymaps.maps.arcgis.com\/sharing\/rest\/oauth2\/token?client_id=MYCLIENTID&client_secret=MYCLIENTSECRET&grant_type=client_credentials"<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">;<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"><\/SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">WebClient<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> wc <\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">=<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> <\/SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: 13px;">new<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> <\/SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">WebClient<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">();<\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:inherit;font-size:13px;"><\/SPAN><SPAN class="" style="color:#101094;border:none;font-weight:inherit;font-size:13px;"><\/>string<\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:inherit;font-size :13px ;"> json <\/SPAN><SPAN class = " "style = " color :#303336 ;border : none ;font - weight : inherit ;font - size :13 px ; "> = < \/ SPAN > < SPAN class = " "style = " color :#303336 ;border : none ;font - weight : inherit ;font - size :13 px ; "> wc < \/ SPAN > < SPAN class = " "style = " color :#303336 ;border : none ;font - weight : inherit ;font - size :13 px ; "> . < \/ SPAN > < SPAN class = " "style = " color :#2b91af ;border : none ;font - weight : inherit ;font - size :13 px ; "> DownloadString < \/ SPAN > < SPAN class = " "style = " color :#303336 ;border : none ;font - weight : inherit ;font - size :13 px ; ">( < \/ SPAN > < SPAN class = " "style = " color :#303336 ;border : none ;font - weight : inherit ;font - size :13 px ; "> webResource < \/ SPAN > < SPAN class = " "style = " color :#303336 ;border : none ;font - weight : inherit ;font - size :13 px ; "> ) ; \n < \/ SPAN > < \/ CODE > < \/ PRE >< P style = " color :#242729;background-color:#f9f8f6;border:none;margin :0 0 1em "> Poté bych parsoval json. < \/ P >< P style = " color :#242729;background-color:#f9f8f6;border:none;margin :0 0 1em "> V současné době dostávám:< \/ P >< BLOCKQUOTE class = " jive_macro_quote jive-quote jive_text_macro ">< P >< CODE >< SPAN class = " "style = " color:#303336;border:none;font-weight :inherit;font-size :13 px "> DTS < \/ SPAN > < SPAN class = " "style = " color:#2b91af;border:none;font-weight :inherit;font-size :13 px "> Script < \/ SPAN > < SPAN class = " "style = " color:#303336;border:none;font-weight :inherit;font-size :13 px "> Task narazil na výjimku v uživatelském kódu:< \/ SPAN > < SPAN class = " "style = " color:#303336;border:none;font-weight :inherit;font-size :13 px "> název projektu:< \/ SPAN > < SPAN class = " "style = " color:#303336;border:none;font-weight :inherit;font-size :13 px "> ST_0a306cf2e1634509bea49b75b7d93265 < \/ SPAN > < SPAN class = " "style = " color:#2b91af;border:none;font-weight :inherit;font-size :13 px "> Exception < \/ SPAN > < SPAN class = " "style = " color:#303336;border:none;font-weight :inherit;font-size :13 px "> byla vyhozena cílem volání< \/ SPAN > .<SPan class=\"\" style=\"color:#303336;border:none;font-weight:i nherit;font-size :13 px \"> v systému System.< /span> #303336; border: 0px; font-weight: inherit; font-size: 13px;"> argumenty</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> v </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">System</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">Reflection</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">RuntimeMethodInfo</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">Invoke</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">Object</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> obj</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">BindingFlags</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> invokeAttr</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">Binder</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> binder</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">,</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> </SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">Object</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">[]</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> parameters</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">,</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> </SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">CultureInfo</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> culture</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">)</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> v </SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">System</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">.</SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">RuntimeType</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">.</SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">InvokeMember</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">(</SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:auto;font-size=13px">String</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> name</SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px">,</SPAN><span> </span><span>...</span> <P styl= border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px;">"expires_in"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">:</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: 13px;">7200</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;">}</SPAN>