<\/HEAD>
Estoy intentando obtener un token para ArcGIS Online usando c# (bueno, más específicamente SSIS). Tengo una url que puedo usar y que funciona bien, y puedo acceder a ella y obtener lo que necesito en Chrome, pero no funciona a través de c# usando un WebClient.<\/P>
<\/P>
Puedo obtener otros jsons a través de SSIS\/C# WebClient, pero POR alguna razón NO ArcGIS Online. La url funciona en Chrome, pero no devuelve una respuesta a través de SSIS\/C# WebClient.<\/P>
Mi código (con client id\/secret\/credentials) es:<\/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: 0px; font-weight: inherit; font-size: 13px;"><\/SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: 13px;">string<\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px"> json <\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">=<\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px"> wc.<\/SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:bold;font-size=13px">DownloadString<\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">(webResource);\n<\/SPAN><\/CODE><\/PRE><P style="color:#242729;background-color:#f9f8f6;border:none;margin-bottom:.5em">Luego analizaría el json.<\/P><P style="color:#242729;background-color:#f9f8f6;border:none;margin-bottom:.5em">Actualmente estoy obteniendo:<\/P><BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"><P><CODE><SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">DTS <\/SPAN><SPAN class="" style="color:#2b91af;border:none;font-weight:bold;font-size=13px">Script<\/SPAN> <SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">Task ha encontrado una excepción <\/SPAN> <SPAN class="" style="color:#101094;border:none;font-weight:bold;font-size=13px">en<\/SPAN> <SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">código de usuario:<\/SPAN> <SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">nombre del proyecto:<\/SPAN> <SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px">ST_0a306cf2e1634509bea49b75b7d93265 <\/SPAN> <SPAN class="" style="color:#2b91af;border:none;font-weight:bold;font-size=13px">Exception<\/SPAN> <SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px"> ha sido lanzada <\/SPAN> <SPAN class="" style="color:#101094;border:none;font-weight:bold;font-size=13px">por<\/SPAN> <SPAN class="" style="color:#303336;border:none;font-weight:bold;font-size=13px"> el objetivo de una invocación.<\/SPAN> <span class='code'>en </span> <span class='keyword'>System</span>.<span class='code'>RuntimeMethodHandle</span>.InvokeMethod(<span class='keyword'>Object</span> target, <span class='keyword'>Object</span>[] arguments, <span class='keyword'>Signature</span> sig, <span class='keyword'>Boolean</span> constructor) en System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(<span class='keyword'>Object</span> obj, <span class='keyword'>Object</span>[] parameters, <span #303336; border: 0px; font-weight: inherit; font-size: 13px;"> argumentos</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;"> en </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: 0px; font-weight: inherit; 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"> en </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 class="" style= 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>