<?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: SOI returning pbf in ArcGIS Enterprise Extensibility Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1065544#M259</link>
    <description>&lt;P&gt;Hi nicogis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for solution!&lt;/P&gt;&lt;P&gt;An update to my issue: the pbf response is returned only with Feature Services, not with Map Services.&lt;/P&gt;&lt;P&gt;Regarding the protoc generator and Esri's specs (for example decoded coordinates are integers that must be transformed again) I think it wold be great if Esri could implement a set of API to simplify encoding/decoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Grazie&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jun 2021 08:09:59 GMT</pubDate>
    <dc:creator>GianniCampanile2</dc:creator>
    <dc:date>2021-06-07T08:09:59Z</dc:date>
    <item>
      <title>SOI returning pbf</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1049024#M254</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am developing a simple SOI to hide some attributes. The environment is 10.8.1 and the service is shared on AGS with copy data e feature access.&lt;/P&gt;&lt;P&gt;The request is very simple:&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;.....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;public byte[] handleRESTRequest(String capabilities, String resourceName, String operationName,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;String operationInput, String outputFormat, String requestProperties, String[] responseProperties)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;throws IOException, AutomationException {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;try {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;IRESTRequestHandler restRequestHandler = soiHelper.findRestRequestHandlerDelegate(so);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;if (restRequestHandler != null) {&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier" size="2"&gt;if (operationName != null &amp;amp;&amp;amp; operationName.equals("query")) {&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT face="courier new,courier" size="2"&gt;byte[] originalResponse = restRequestHandler.handleRESTRequest(capabilities, resourceName,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;operationName, operationInput, outputFormat, requestProperties, responseProperties);&lt;/FONT&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier" size="2"&gt;// parse response and hide attributes&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;.....&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The problem is that the outputFormat is "pbf", i.e. I cannot convert the reponse to JSON. If I set "json" before the call, than the response is ok but the caller expects "pbf" so it won't work.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/no-supportedqueryformats-pbf-option-for-hosted-feature-services/td-p/148582" target="_blank" rel="noopener"&gt;Here&lt;/A&gt; there is the solution for Javascript, but I cannot figure out how to solve it in java. Is there a way to avoid to have a request for pbf or a conversion pbf2json ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gianni&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE: Even if I intercept the "info" request (resourceName, operationName and operationInput are empty) and modifying the supportedQueryOutputs from "JSON, GeoJSON,PBF "to "JSON, GeoJSON" the problem is not solved.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 09:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1049024#M254</guid>
      <dc:creator>GianniCampanile2</dc:creator>
      <dc:date>2021-04-22T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: SOI returning pbf</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1065445#M256</link>
      <description>&lt;P&gt;Ciao Gianni,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The FeatureCollection is an encoding of feature geographic and attribute data structures using the&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.google.com/protocol-buffers/docs/reference/proto3-spec" rel="nofollow" target="_blank"&gt;Protocol Binary Format (PBF)&lt;/A&gt;&lt;SPAN&gt;. Notably, the FeatureCollection is an alternative encoding of a&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/featureset-object.htm" rel="nofollow" target="_blank"&gt;FeatureSet&lt;/A&gt;&lt;SPAN&gt;, ESRI's JSON encoding of&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/feature-object.htm" rel="nofollow" target="_blank"&gt;Feature objects&lt;/A&gt;&lt;SPAN&gt;. Not only are FeatureCollections serialized differently through the use of a new binary specification, but they also have fundamental structural differences that developers will need to account for.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;here you can see the initial specification&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-pbf/tree/main/proto/FeatureCollection" target="_blank"&gt;arcgis-pbf/proto/FeatureCollection at main · Esri/arcgis-pbf · GitHub&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you can generate your class in for example c#&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;protoc.exe FeatureCollection.proto --csharp_out=C:/Temp/Scratch/out --proto_path=c:/Temp/Scratch/pbf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you can download protoc.exe here&amp;nbsp;&lt;A href="https://github.com/protocolbuffers/protobuf/releases/tag/v3.17.2" target="_blank"&gt;Release Protocol Buffers v3.17.2 · protocolbuffers/protobuf · GitHub&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FeatureCollection.proto&amp;nbsp; (&amp;nbsp;&lt;A href="https://raw.githubusercontent.com/Esri/arcgis-pbf/main/proto/FeatureCollection/FeatureCollection.proto" target="_blank"&gt;https://raw.githubusercontent.com/Esri/arcgis-pbf/main/proto/FeatureCollection/FeatureCollection.proto&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then with your class generated you can write similar code to deserialize pbf:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;FeatureCollectionPBuffer f = (File.ReadAllBytes(@"C:\Temp\Scratch\pbf\query")).ToObject&amp;lt;FeatureCollectionPBuffer&amp;gt;();


public static T ToObject&amp;lt;T&amp;gt;(this byte[] buf) where T : IMessage&amp;lt;T&amp;gt;, new()
        {
            if (buf == null)
                return default(T);

            using (MemoryStream ms = new MemoryStream())
            {
                ms.Write(buf, 0, buf.Length);
                ms.Seek(0, SeekOrigin.Begin);

                MessageParser&amp;lt;T&amp;gt; parser = new MessageParser&amp;lt;T&amp;gt;(() =&amp;gt; new T());
                return parser.ParseFrom(ms);
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 14:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1065445#M256</guid>
      <dc:creator>nicogis</dc:creator>
      <dc:date>2021-06-06T14:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: SOI returning pbf</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1065544#M259</link>
      <description>&lt;P&gt;Hi nicogis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for solution!&lt;/P&gt;&lt;P&gt;An update to my issue: the pbf response is returned only with Feature Services, not with Map Services.&lt;/P&gt;&lt;P&gt;Regarding the protoc generator and Esri's specs (for example decoded coordinates are integers that must be transformed again) I think it wold be great if Esri could implement a set of API to simplify encoding/decoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Grazie&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 08:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-extensibility-questions/soi-returning-pbf/m-p/1065544#M259</guid>
      <dc:creator>GianniCampanile2</dc:creator>
      <dc:date>2021-06-07T08:09:59Z</dc:date>
    </item>
  </channel>
</rss>

