Hi!
I would like to get information about the service urls privided at my onw portal.
So like to start with Esri::ArcGISRuntime::Portal, but how?
Thx in advance!
Norbert
Hi Norbert,
This documentation discusses how you sign into your Portal - Access the ArcGIS platform—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
To access items, see this topic - Access portal content—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
And to search, see this topic - Search for content—ArcGIS Runtime SDK for Qt | ArcGIS for Developers
The high level workflow is:
- Create Portal object using your URL, and pass in credentials with username and password
- Load the Portal and wait fo it to be done loading
- Call findItems on the Portal object by passing in query parameters
- Get your desired Portal Item from this list
Hi Luke!Thanks for your quick answer 🙂
I tried my own URL "http://xyz.de" with credentials
After load i get doneLoading and errorOccured with:
Esri::ArcGISRuntime::Error: code=404, domain=0, extendedErrorType=0, message='Error transferring http://excgeo20.sl.defence-elec.de/sharing/rest/info?f=json - server replied: Not Found', additionalMessage='Error transferring http://excgeo20.sl.defence-elec.de/sharing/rest/info?f=json - server replied: Not Found'
Any ideas?
Norbert- are you on the same internal network? If not, is your portal accessible outside your network? Also, did you set up your proxy? It should be as simple as the code in the doc:
QUrl portalUrl <SPAN class="operator token">=</SPAN> <SPAN class="token function">QUrl</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fgeoportal.mycompany.com" target="_blank">http://geoportal.mycompany.com</A><SPAN>"</SPAN></SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Credential<SPAN class="operator token">*</SPAN> portal_Credential <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">Credential</SPAN><SPAN class="punctuation token">(</SPAN>portalUsername<SPAN class="punctuation token">,</SPAN> portalPassword<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Portal<SPAN class="operator token">*</SPAN> onPremisesPortal <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">Portal</SPAN><SPAN class="punctuation token">(</SPAN>portalUrl<SPAN class="punctuation token">,</SPAN> portal_Credential<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="token function">connect</SPAN><SPAN class="punctuation token">(</SPAN>onPremisesPortal<SPAN class="punctuation token">,</SPAN> <SPAN class="operator token">&</SPAN>Portal<SPAN class="operator token">::</SPAN>loadStatusChanged<SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> onPremisesPortal<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">(</SPAN>LoadStatus loadStatus<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>loadStatus <SPAN class="operator token">==</SPAN> LoadStatus<SPAN class="operator token">::</SPAN>Loaded<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> PortalInfo<SPAN class="operator token">*</SPAN> info <SPAN class="operator token">=</SPAN> onPremisesPortal<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">portalInfo</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="token function">qDebug</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token"><<</SPAN> info<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">portalName</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> onPremisesPortal<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">load</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Hi Luke!
I use my own map example to load an arcgisonline basemap tu guarantee that internet access is working.
In the same example i configure this portal url without credentials:
new Esri::ArcGISRuntime::Portal(QStringLiteral("http://www.argis.com"));
or
new Esri::ArcGISRuntime::Portal(QStringLiteral("http://www.argis.com"), false);
After a few seconds:
2018-10-10 11:39:27.096 ERROR Portal |#| void SituationMap::Portal::onPortalDoneLoading(const Esri::ArcGISRuntime::Error &) Portal -> EsriError occured: Esri::ArcGISRuntime::Error: code=404, domain=0, extendedErrorType=0, message='Error transferring https://www.argis.com/sharing/rest/portals/self?f=json - server replied: Not Found', additionalMessage='Error transferring https://www.argis.com/sharing/rest/portals/self?f=json - server replied: Not Found' (SituationMap/Portal/portal.cpp:141)
2018-10-10 11:39:27.096 ERROR Portal |#| void SituationMap::Portal::onPortalErrorOccurred(const Esri::ArcGISRuntime::Error &) Portal -> EsriError occured: Esri::ArcGISRuntime::Error: code=404, domain=0, extendedErrorType=0, message='Error transferring https://www.argis.com/sharing/rest/portals/self?f=json - server replied: Not Found', additionalMessage='Error transferring https://www.argis.com/sharing/rest/portals/self?f=json - server replied: Not Found' (SituationMap/Portal/portal.cpp:132)
Is this maybe also not implemented on linux?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.