<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Silverlight Proxy Page: proxy.ashx in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216080#M5417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Since POSTed requests from the Web API to the proxy always contain text, this content type will work.&amp;nbsp; However if you wanted to use the proxy to upload a file, you'd probably want to go with multipart/form-data.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to use the proxy to upload a file, and to go with multipart/form-data, what can I do? Could you give me some code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jun 2011 15:11:34 GMT</pubDate>
    <dc:creator>FengLin</dc:creator>
    <dc:date>2011-06-29T15:11:34Z</dc:date>
    <item>
      <title>Silverlight Proxy Page: proxy.ashx</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216077#M5414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was recently comparing the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/help/SLProxyPage.zip"&gt;Silverlight proxy page&lt;/A&gt;&lt;SPAN&gt; to the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp/proxypage_net.zip"&gt;JavaScript API's equivalent&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Silverlight &lt;/SPAN&gt;&lt;STRONG&gt;proxy.ashx&lt;/STRONG&gt;&lt;SPAN&gt; has a more recent timestamp and more functionality, so I assumed the JavaScript proxy page was out-of-date.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Two (hopefully quick) questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Can I use the Silverlight proxy page as a drop-in replacement for the JavaScript API's proxy page, or are they deliberately kept separate?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) The Silverlight proxy.ashx forces the Content-Type of the response sent back to the client to be &lt;/SPAN&gt;&lt;STRONG&gt;application/x-www-form-urlencoded&lt;/STRONG&gt;&lt;SPAN&gt;, but the JavaScript proxy.ashx does not. Is there a reason for this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any responses. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 16:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216077#M5414</guid>
      <dc:creator>SimonLiu</dc:creator>
      <dc:date>2011-03-24T16:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight Proxy Page: proxy.ashx</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216078#M5415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The proxy page included with the Silverlight API is a streamlined/enhanced version of the one included with the JavaScript API.&amp;nbsp; Basically generating the request and processing the response have been streamlined for the Web APIs.&amp;nbsp; Plus the proxy included with the Silverlight API supports secured services using tokens (long and short term) and http/windows authentication.&amp;nbsp; The JavaScript API proxy only supports long term tokens.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Yes.&amp;nbsp; As far as redirecting requests is concerned, the proxies are basically the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) The Silverlight API proxy sets the content type of the request (if a POST) to "application/x-www-form-urlencoded" because its only been designed to support the use of a proxy (e.g. ProxyUrl) within the Web APIs.&amp;nbsp;&amp;nbsp; Since POSTed requests from the Web API to the proxy always contain text, this content type will work.&amp;nbsp; However if you wanted to use the proxy to upload a file, you'd probably want to go with multipart/form-data.&amp;nbsp; Of course you can try to set it on the fly like in the JavaScript API.&amp;nbsp;&amp;nbsp; Keep in mind you can modify the proxy at will; it only provides a workable starting point to support the use of a proxy in the Web APIs.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideally at some point in the future the proxies will be synchronized.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 20:45:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216078#M5415</guid>
      <dc:creator>RexHansen</dc:creator>
      <dc:date>2011-03-24T20:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight Proxy Page: proxy.ashx</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216079#M5416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;2) The Silverlight proxy.ashx forces the Content-Type of the response sent back to the client to be &lt;STRONG&gt;application/x-www-form-urlencoded&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Oops, I meant to say "the response sent from the proxy to the server", not "the response sent back to the client".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks for your reply Rex, it was very informative and helped clear up some confusion in my mind.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I was wondering about this part of your answer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Since POSTed requests from the Web API to the proxy always contain text, this content type will work.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't think this is always true, because all three web APIs support adding file attachments to feature services on ArcGIS Server 10 (for example, see the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitAttachmentEditor"&gt;Silverlight AttachmentEditor&lt;/A&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the feature service were locked down and required a proxy page to access it, then file uploads would fail because the Silverlight proxy page doesn't set the content type dynamically at the moment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously this is a trivial thing to fix, but since the other two APIs' proxy pages already set content types on the fly rather than hard-coding it, could this be changed in the Silverlight proxy page as well?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Simon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 10:24:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216079#M5416</guid>
      <dc:creator>SimonLiu</dc:creator>
      <dc:date>2011-03-30T10:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Silverlight Proxy Page: proxy.ashx</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216080#M5417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Since POSTed requests from the Web API to the proxy always contain text, this content type will work.&amp;nbsp; However if you wanted to use the proxy to upload a file, you'd probably want to go with multipart/form-data.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to use the proxy to upload a file, and to go with multipart/form-data, what can I do? Could you give me some code?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 15:11:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/silverlight-proxy-page-proxy-ashx/m-p/216080#M5417</guid>
      <dc:creator>FengLin</dc:creator>
      <dc:date>2011-06-29T15:11:34Z</dc:date>
    </item>
  </channel>
</rss>

