<?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: problem with ResponseProperties.ResponseDataType in REST SOE in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371506#M1773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could generate the image into a file and return it as bytes, and specifying a MIME type as "image/..." as the Content-Type.&lt;BR /&gt;&lt;BR /&gt;You could do:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; //Generate your image
&amp;nbsp; byte [] image = image.getBytes();
&amp;nbsp; responseProperties[0] = @"{"Content-Type" : "image/png" }"
&amp;nbsp; return bytes;
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Raul: responseProperties is a string. it isn't a string[].&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:12:50 GMT</pubDate>
    <dc:creator>nicogis</dc:creator>
    <dc:date>2021-12-11T17:12:50Z</dc:date>
    <item>
      <title>problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371500#M1767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I really like the concept of supporting REST in SOE and I have been working on it since past couple of months.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I am following the presentation - Extending AGS Services Using .NET to develop SOE that provides REST services. I was looking for an option where i can stream the image in the output response. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used ResponseProperties.ResponseDataType = esriWebResponseDataType.esriWRDTFileToReturn in an operation and returned the file name from the operation. The ESRI server gives an error saying Could not find a part of the path. I tried many possible combinations. I thought giving an absolute path such as "c:\arcgisoutput\test.jpg" should work but doing so gives c:\ is not a virtual path. I think ESRI server use Response.TransmitFile to stream the file contents back to the client. Where does the ESRI server looks for the file. Shouldn't giving the absolute file path work?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jul 2010 14:26:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371500#M1767</guid>
      <dc:creator>PrashantKhanal</dc:creator>
      <dc:date>2010-07-09T14:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371501#M1768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could generate the image into a file and return it as bytes, and specifying a MIME type as "image/..." as the Content-Type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; //Generate your image
&amp;nbsp; byte [] image = image.getBytes();
&amp;nbsp; responseProperties[0] = @"{"Content-Type" : "image/png" }"
&amp;nbsp; return bytes;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:12:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371501#M1768</guid>
      <dc:creator>RahulRavikumar</dc:creator>
      <dc:date>2021-12-11T17:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371502#M1769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Returning image as bytes and changing the "Content-Type" header sounds a good approach. To my understanding, for every REST operation, the client must specify the output format as say f=json or f=html or f=pjson and I believe the SOE REST request handler only support these three formats for now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So my concern is the requested output format can be either json/pjson/html even though my operation tries to send the image bytes with proper "Content-Type" header. Isn't it misleading?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Correct me if I am missing something in here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 02:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371502#M1769</guid>
      <dc:creator>PrashantKhanal</dc:creator>
      <dc:date>2010-07-12T02:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371503#M1770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the reply.&lt;BR /&gt;Returning image as bytes and changing the "Content-Type" header sounds a good approach. To my understanding, for every REST operation, the client must specify the output format as say f=json or f=html or f=pjson and I believe the SOE REST request handler only support these three formats for now.&lt;BR /&gt;So my concern is the requested output format can be either json/pjson/html even though my operation tries to send the image bytes with proper "Content-Type" header. Isn't it misleading?&lt;BR /&gt;Correct me if I am missing something in here?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Prashant,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While my SOE is generating PNG images on the fly, and returning them in the response (instead of writing them to disk, on the server, and returning a URL to them), you might find my thread of interest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/7993-SOE-REST-Web-Service-How-to-return-different-MIME-content-types"&gt;http://forums.arcgis.com/threads/7993-SOE-REST-Web-Service-How-to-return-different-MIME-content-types&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't yet received a solution to my problem, but I thought that since we appear to be performing similar work, you might like to see what the solution to my issue is - assuming I'm able to find one. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Brooks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 14:41:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371503#M1770</guid>
      <dc:creator>BrooksShannon</dc:creator>
      <dc:date>2010-07-12T14:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371504#M1771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Brooks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I saw your post and i did work the way you described but haven't found solution yet &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; . Somehow i feel i am closer to the solution but haven't reached there yet. So i have been trying different tricks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question to you is what would be the requested output format to invoke your operation that returns the PNG image as bytes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One way i found to work with images as per the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;page 50 in &lt;/SPAN&gt;&lt;A href="http://proceedings.esri.com/library/...using_.net.pdf"&gt;http://proceedings.esri.com/library/...using_.net.pdf&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the ResponseProperties.ResponseDataType = esriWebResponseDataType.esriWRDTFileToReturn;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way the ESRI server tries to stream the file. The returned bytes for such operation should be the virtual path to the file name to my understanding. I am getting error in virtual path doing so. That does mean the ESRI server is looking for the file to stream in response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now the way you did, So you are able to get the PNG response but there is some error in PNG response right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you send me the snippet of your operation that sends the PNG image and how did you create the operation. What were the supported ouptut formats?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps I can move forward with your help and we can figure out the solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Prashant Khanal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 15:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371504#M1771</guid>
      <dc:creator>PrashantKhanal</dc:creator>
      <dc:date>2010-07-12T15:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371505#M1772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Problem Solved!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem does not exist anymore in the released version.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jul 2010 14:38:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371505#M1772</guid>
      <dc:creator>PrashantKhanal</dc:creator>
      <dc:date>2010-07-15T14:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: problem with ResponseProperties.ResponseDataType in REST SOE</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371506#M1773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could generate the image into a file and return it as bytes, and specifying a MIME type as "image/..." as the Content-Type.&lt;BR /&gt;&lt;BR /&gt;You could do:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; //Generate your image
&amp;nbsp; byte [] image = image.getBytes();
&amp;nbsp; responseProperties[0] = @"{"Content-Type" : "image/png" }"
&amp;nbsp; return bytes;
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Raul: responseProperties is a string. it isn't a string[].&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/problem-with-responseproperties-responsedatatype/m-p/371506#M1773</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2021-12-11T17:12:50Z</dc:date>
    </item>
  </channel>
</rss>

