ãããæè¿ãWSO2 Data Services Serverã¯ãæ°æ©èœãæŽçããŠãããšãã«ãGoogleã¹ãã¬ããã·ãŒãïŒââåŸã§ã©ãã§ãå ¥æã§ããïŒãæäœããããã®SOAPãµãŒãã¹ãç°¡åã«å®è£ ã§ããããšãçºèŠããŸããã ããã«ãããŒãã«å ã®ããŒã¿ã®åŠçã¯ãéåžžã®SQLãä»ããŠå®è¡ãããŸãã
ãããè¡ãæ¹æ³ã«ã€ããŠã¯ãã«ããã®äžã§ãäŒãããããšæããŸãã
ïŒçªç¶ããã®æçš¿ãã©ããã§èŠãããšããããšæãããå Žå-é©ããªãã§ãã ãã-æåŸã®æçš¿ãçŠæ¢ãããŸãã-ãªã³ã¯ãæã¡éããŠããŸããŸãã-ããã§ä¿®æ£ããããšããŸããïŒã
WSO2 Data ServicesãµãŒããŒãšã¯äœã§ããïŒ
ããããæåã«ãå°ããªæè²ããã°ã©ã ã WSO2ãšã¯äœã§ããïŒ åçŽãªå Žåãããã¯åäžã®Carbon OSGIãã©ãããã©ãŒã ã«ã€ã³ã¹ããŒã«ãããäžé£ã®ãªãŒãã³ãœãŒã¹ãããžã§ã¯ãïŒäž»ã«Apacheã¹ã¿ãã¯ããïŒã§ãã ãã®çµæããããžã§ã¯ããã補åãååŸããŸã-åäžã®ç®¡çããã«ããµããŒããªã©ã䜿çšããŸãã WSO2ã¯ãå¹ åºãçµ±åã®èª²é¡ãã«ããŒããŠããŸãã
ç§ãã¡ã®å ŽåãããŒã¿ãžã®ã¢ã¯ã»ã¹ãæŽçããããã«WSO2 Data Services Serverã䜿çšãããããŒã¿ãœãŒã¹ã¯éåžžã«ç°ãªãå ŽåããããŸã-éåžžã®ããŒã¿ããŒã¹ïŒMySQLããDB2ãž-倧ãŸãã«èšãã°ãJDBCãã©ã€ããŒããããŸãïŒãšNoSQLããŒã¿ããŒã¹ãããã³ãã¡ã€ã«ïŒCSVãExcelïŒããã³å€éšãµãŒãã¹ïŒãã®å Žåã¯Googleã¹ãã¬ããã·ãŒãïŒã ãããã¯ãã¹ãŠãSOAPãŸãã¯RESTãµãŒãã¹ã§ã©ããã§ããŸãã

WSO2 Data ServicesãµãŒããŒãã€ã³ã¹ããŒã«ãã
WSO2補åã䜿çšããéã«äŸ¿å©ãªã®ã¯ãã€ã³ã¹ããŒã«ãæ§æãããã³ãµããŒãã®ç¹ã§ããã¹ãŠåãååã«åºã¥ããŠããããšã§ãã WSO2 DSSãã€ã³ã¹ããŒã«ããããšã¯ãWSO2 ESBãã€ã³ã¹ããŒã«ããããšãšéãã¯ãããŸããããã®äŸã¯ãããšãã°ããã«ãããŸã ã 倧ãŸãã«èšãã°-ããŠã³ããŒããã¢ã³ããã¯ãèµ·å-ãããŠåºæ¥äžãã-æ°ç§åŸã«ã¢ãã¬ã¹ïŒããã©ã«ãïŒhttpsïŒ// localhostïŒ9443 / carbonïŒãã°ã€ã³ã®ãã¹ã¯ãŒãã¯admin / adminïŒã®ç®¡çããã«ã«ç§»åã§ããŸã

GoogleããŒãã«
Googleã¹ãã¬ããã·ãŒãã«äŒããªãããš-誰ããç¥ã£ãŠãããšæããŸãã äœæ¥ãããã¹ãããŒãã«ãäœæããŸã-ããšãã°ã3ã€ã®å-IDãFirstNameãLastName

ããŒãã«ã¯ã docs.google.com / spreadsheets / d / 1k4jebSdGJ39nyDnIc505PI0H2XKk8Q8ewxSpe71 / edit ïŒgid = 0ã®ãããªãªã³ã¯ã§éããŸããã/ç·šéããžã®ãªã³ã¯ã®äžéšã¯ãã¢ã¯ã»ã¹ã®ããã«åŸã§äœ¿çšããå¿ èŠãããããŒãã«ã®URLã§ãã
docs.google.com/spreadsheets/d/1k4jebSdGJ39nyDnIc505PI0H2XKk8Q8ewxSpe71
ãµãŒãã¹äœæ
å·ŠåŽã®ã¡ãã¥ãŒã§ãµãŒãã¹ãäœæããã«ã¯ã[ãµãŒãã¹]-> [è¿œå ]-> [äœæ]ãéžæããŸãã æåã®ç»é¢ã§ãåºæ¬ããŒã¿ãå ¥åããŸã-ãµãŒãã¹ã®ååïŒç§ã®å Žåã¯GoogleClientsãããŒã ã¹ããŒã¹ïŒç§ã®å Žåã¯ws.wso2.org/dataservices/google_client ïŒãä»ã®ãã©ã¡ãŒã¿ãŒã䜿çšã§ããŸããæ®ãã®ãã©ã¡ãŒã¿ãŒã¯ããã©ã«ãã®ãŸãŸã«ããŸãã

ããŒã¿ãœãŒã¹ã®äœæ
次ã®ã¹ãããã¯ãããŒã¿ãœãŒã¹ãèšå®ããããšã§ãã 1ã€ã®ãµãŒãã¹ã§è€æ°ã®ãœãŒã¹ãäžåºŠã«äœ¿çšã§ããŸããGoogleã¹ãã¬ããã·ãŒãããœãŒã¹ãšããŠè¿œå ããå¿ èŠããããŸãã
次ã®ã¹ãããã§ã¯ããããŒã¿ãœãŒã¹ã®è¿œå ããšèšããéãããã©ãŒã ã«ååïŒgoogleTableãªã©ïŒãå ¥åããã¿ã€ãïŒGoogleã¹ãã¬ããã·ãŒãïŒãéžæããŠããã¯ãšãªã¢ãŒãã䜿çšãããã¯ã¹ããªã³ã«ããŸãïŒããã«ãããSQLã§ããŒãã«ãšéä¿¡ã§ããããã«ãªããŸãïŒã
ããã«èå³æ·±ã-ããŒãã«ãžã®æ¥ç¶ãèšå®ããå¿ èŠããããŸãã Googleã¹ãã¬ããã·ãŒãã®URLãšããŠãäžã§ç€ºããããã«ããŒãã«ã®URLã䜿çšããŸãã
ãã ãã次ã®ãã£ãŒã«ãã§ã¯æ©èœããå¿ èŠããããŸãã
Google Developers Consoleã§ã¢ããªã±ãŒã·ã§ã³ãç»é²ãã
次ã®ãã£ãŒã«ãã¯ãã¯ã©ã€ã¢ã³ãIDãšã¯ã©ã€ã¢ã³ãã·ãŒã¯ã¬ãã-Googleã¹ãã¬ããã·ãŒããããã¯ããã¢ããªã±ãŒã·ã§ã³ïŒãã®å Žåã¯ãµãŒãã¹ïŒã®IDã§ãã ãã®ããŒã¿ãååŸããã«ã¯ãGoogle Developers ConsoleïŒ console.cloud.google.comã«ã¢ã¯ã»ã¹ããããã«æ°ããã¢ããªã±ãŒã·ã§ã³ãç»é²ããOAuth2æ¿èªãè¿œå ããŸãïŒAPIïŒAuth-> Credentials-> Add Credentials-> OAuth 2.0 client IDïŒã ããŒãäœæãããšãã¯ãããŒã¿ãœãŒã¹ã®ç»é²æã«äœ¿çšãããã®ãšåããæ¿èªæžã¿ãªãã€ã¬ã¯ãURIããæå®ããå¿ èŠããããŸãïŒæãåçŽãªã±ãŒã¹ã§ã¯ã localhost ïŒ9443 / authCodeReceiverã§ãã

äœæåŸãããŒã¿ãœãŒã¹ç»é²ãã©ãŒã ã§æå®ããå¿ èŠãããã¯ã©ã€ã¢ã³ãIDãšã¯ã©ã€ã¢ã³ãã·ãŒã¯ã¬ãããåãåããŸãã æåŸã«ååŸããå¿ èŠãããã®ã¯ããããŒã¯ã³ã®æŽæ°ãã§ããããã¯ãç§ãã¡ã®ããã«åãç¹å®ã®ãŠãŒã¶ãŒã«é¢ããæ å ±ããä¿è·ããããããŒã¯ã³ã§ãããã®ããã«ã¯ããããŒã¯ã³ã®çæããã¿ã³ãã¯ãªãã¯ããŸããGoogleã«ãã°ã€ã³ããããã«æ±ããããŸãããœãŒã¹ããŒãã«ãžã®ã¢ã¯ã»ã¹æš©ãããïŒããã³ã¢ã¯ã»ã¹èš±å¯ã ãã®çµæãåä¿¡ããæŽæ°ããŒã¯ã³ããã£ãŒã«ãã«ïŒèªåçã«ïŒæ¿å ¥ãããŸãã 次ã«ããæ¥ç¶ã®ãã¹ãããæŒããŸã-ãã¹ãŠãããŸããã£ãå Žå-ããªãã¯è¯å®çãªçµæãåŸãã§ããã-ããªãã¯å ã«é²ãããšãã§ããŸãã

ã¯ãšãªãäœæãã
ãã¹ãŠãéæ³ã®ã¹ããããééããŸãã-ãã¹ãŠãç°¡åã§ãã 次ã®ã¹ãããã¯ãã¯ãšãªãäœæããããšã§ãã ãã¹ãŠã®ã¬ã³ãŒããèŠæ±ããããšããå§ããŸãããã 次ã®ã¹ããããã¯ãšãªãã§ãæ°ããã¯ãšãªã®è¿œå ããã¯ãªãã¯ããŠãã¯ãšãªã®äœæãéå§ããŸãã
- ãªã¯ãšã¹ãå ïŒäŸïŒselectClients
- ããŒã¿ãœãŒã¹ ïŒæåŸã®æé ã§äœæãããgoogleTableãéžæããŸã
- ã¯ãšãª ïŒ Sheet1ããIDãFirstNameãLastNameãéžæããŸã-IDãFirstNameãLastNameã¯ããŒãã«ã®åã®ååãSheet1ã¯ã¿ãã®ååã§ã
ã¯ããã¯ããã¯ãïŒ ããããã€ã³ãã§ãã䜿ãæ £ããSQLã䜿çšããŠGoogleã¹ãã¬ããã·ãŒããæäœããŸãã
次ã«ããå¿çã®çæããã¯ãªãã¯ããŸããåºåãã£ãŒã«ãã¯ååã«ãã£ãŠçæãããŸãããèŠçŽ ããšã®ã°ã«ãŒãåããå€æŽããããšããå§ãããŸããããšãã°ããã¯ã©ã€ã¢ã³ããããã³ãè¡åãããã¯ã©ã€ã¢ã³ããã«å€æŽããŸãããããã®ååã¯å¿çã¿ã°ã§äœ¿çšãããŸãã å¿ èŠã«å¿ããŠãçæããããåºåãããã³ã°ããç·šéã§ããŸãã

åæ§ã«ã InsertQuery ãSheet1ïŒIDãFirstNameãLastNameïŒã®å€ïŒïŒãïŒãïŒïŒãžã®æ¿å ¥ãšããŠäœæããŸãïŒ ãå ¥åãããã³ã°ã®çæããã¯ãªãã¯ããã ãã§ãèŠæ±å ã®è³ªåã®æ°ã«åŸã£ãŠïŒå ¥åãã©ã¡ãŒã¿ãŒãçæããŸãã ãããã¯ååãšã¿ã€ãã«åãããŠç·šéããã®ãæé©ã§ãã

åæ§ã«ãä»ã®ã¯ãšãªïŒãã©ã¡ãŒã¿ãŒã䜿çšããéžæãšæŽæ°ãšåé€ã®äž¡æ¹ïŒãçæã§ããŸããGoogleããŒãã«ãéåžžã®SQLããŒãã«ãšããŠäœ¿çšã§ããããšãéèŠã§ãã è€éãªã¯ãšãªãã©ã®ããã«ãµããŒããããŠãããã¯èª¿æ»ããŸããã§ããããç§ã®å Žåã¯ãåçŽã§åºæ¬çãªã¯ãšãªãååã«ãããŸããã
æäœãäœæãã
次ã®ã¹ãããã¯ç°¡åã§ãããªã¯ãšã¹ãããšã«ãªãã¬ãŒã·ã§ã³ïŒãµãŒãã¹ã¡ãœããïŒãçæããŸãã ããã§ã¯ãã¹ãŠãç°¡åã§ã-æäœãäœæãããããã©ã®ãªã¯ãšã¹ãã§ãããã瀺ããŸãã

ãµãŒãã¹ãã¹ã
ãå®äºããã¯ãªãã¯ããŸã-ããã ãã§ã-Googleã¹ãã¬ããã·ãŒããæäœããããã®SOAPãµãŒãã¹ã®æºåãã§ããŸããïŒ ããªãã¯ããããã¹ãããããšãã§ããŸã-ãµãŒãã¹ã®ãªã¹ãã§ããTry this serviceããã¯ãªãã¯ããŠãã ãã-ãããŠãéãããŠã£ã³ããŠã§ãæäœãéžæããå¿ èŠã«å¿ããŠãã©ã¡ãŒã¿ãå ¥åããŠ-è¡ã£ãŠãã ããã

ããã ãã§ãïŒ ãµãŒãã¹ã®æºåãã§ããŸãã-ããã§ããã¹ãŸãã¯ä»ã®ã¢ããªã±ãŒã·ã§ã³ããããŒãã«ãæäœã§ããŸãïŒWSDLã䜿çšããŠããã®ãµãŒãã¹ãåŒã³åºãã¯ã©ã€ã¢ã³ãã³ãŒããç°¡åã«çæã§ããŸãïŒã ClientIDãSecret KeyãRefresh Tokenã䜿çšããŠãéæ³ãã«ã€ãŸãããªããšããã¹ãŠãæã«å ¥ããŸãã
åæã«ãåçŽãªSQLã¯ãšãªãé€ããŠãã³ãŒãã1è¡ãèšè¿°ããŸããã§ããã