Hi Joachim,
hier die funktionierende Lösung. Den Webservice habe ich im JSON Format angesprochen. Den Key bekommst Du von der Google Developer Console
Viele GrüßeCode:ctl-opt dftactgrp(*no) main(main); //------------------------------------------------------------------// // // // Get Google Data // // // //----------------- // // R.Ross 11.2018 * // //------------------------------------------------------------------// // SQL-Options // //------------------------------------------------------------------// exec sql set option datfmt=*iso, timfmt=*iso, commit=*none, decmpt=*period, closqlcsr=*endactgrp; //------------------------------------------------------------------// // Main // //------------------------------------------------------------------// dcl-proc main; dcl-s LocLat packed(11:8); dcl-s LocLon packed(11:8); dcl-s LocURL varchar(256); dcl-s LocAddress varchar(256); exec sql set :LocAddress = systools.urlencode('Bgm.-Hollweck-Straße 6, 85599 Parsdorf', 'UTF-8'); LocURL = 'https://maps.googleapis.com/maps/api/geocode/json?address=' + LocAddress + '&key=AaaaaaaaaaaaaaaaK_PYp2iSKKNVJow7Q3-MsmSvo' + '&components=country:DE'; exec sql Select Latitude, Longitude into :LocLat, :LocLon from JSON_TABLE( SYSTOOLS.HTTPGETCLOB(:LocUrl,''), '$' Columns( Latitude dec(11, 8) path '$.results.geometry.location.lat', Longitude dec(11, 8) path '$.results.geometry.location.lng' ) ); end-proc; //------------------------------------------------------------------//
Rainer
![[NEWSboard IBMi Forum]](images/duke/nblogo.gif)



Mit Zitat antworten
Bookmarks