<\/HEAD>
私はc#(正確にはSSIS)を使ってArcGIS Onlineのトークンを取得しようとしています。使えるURLがあり、それはChromeではうまく動作し、必要なものを取得できますが、WebClientを使ったc#経由では動作しません。<\/P>
<\/P>
SSIS\/C# WebClientを通じて他のjsonは取得できますが、なぜかArcGIS Onlineはできません。URLはChromeでは動作しますが、SSIS\/C# WebClientでは応答が得られません。<\/P>
私のコード(client id\/secret\/credentials付き)は以下の通りです:<\/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">その後、jsonを解析します。<\/P><P style="color:#242729;background-color:#f9f8f6;border:none;margin-bottom:.5em">現在、以下のエラーが発生しています:<\/P><BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"><P><CODE><SPAN style="color:#303336;border:none;font-weight:bold;font-size=13px">DTS <\/SPAN><SPAN style="color:#2b91af;border:none;font-weight:bold;font-size=13px">Script<\/SPAN> <SPAN style="color:#303336;border:none;font-weight:bold;font-size=13px">Task にユーザーコード内で例外が発生しました:<\/SPAN> project name:<span style='font-weight:bold'>ST_0a306cf2e1634509bea49b75b7d93265</span> <span style='color:#2b91af'>Exception</span> がスローされました <span>呼び出し対象によって</span>。 at <span style='color:#2b91af'>System</span>.<span>RuntimeMethodHandle</span>.<span>InvokeMethod</span>(Object target, Object[] arguments, Signature sig, Boolean constructor) at <span style='color:#2b91af'>System</span>.<span>Reflection</span>.<span>RuntimeMethodInfo</span>.<span>UnsafeInvokeInternal</span>(Object obj, Object[] parameters, Object[] #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: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> で <\/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: #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: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">Binder<\/SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: 13px;"> binder<\/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">Object<\/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:#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"> at <\/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="color:#2b91af;border:none;font-weight:auto;font-size=13px">BindingFlags<\/SPAN><SPAN class="" style="color:#303336;border:none;font-weight:auto;font-size=13px"> bindingFlags<\/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">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:#2b91af;border:none;font-weight:auto;font-size=13px">Object<\/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>