{"id":52,"date":"2011-08-11T15:58:11","date_gmt":"2011-08-11T15:58:11","guid":{"rendered":"http:\/\/www.uturtle.com\/blog\/archives\/52"},"modified":"2013-12-17T02:43:24","modified_gmt":"2013-12-16T17:43:24","slug":"gsoap%ec%9d%84-%ec%9d%b4%ec%9a%a9%ed%95%9c-%ea%b0%84%eb%8b%a8%ed%95%9c-soap-provider-%ec%a0%9c%ec%9e%91","status":"publish","type":"post","link":"https:\/\/www.jinukbaek.com\/blog\/ko\/archives\/52","title":{"rendered":"gSOAP\uc744 \uc774\uc6a9\ud55c \uac04\ub2e8\ud55c SOAP Provider \uc81c\uc791"},"content":{"rendered":"<p>\ubcf8 \ubb38\uc11c\ub294 gSOAP User Guide[1]\ub97c \uae30\ubc18\uc73c\ub85c \ud574\uc11c \uc791\uc131\ud558\uc600\uc74c.<\/p>\n<p>&#8211; gSOAP\uc73c\ub85c \uad6c\ud604\ub41c WS Provider\ub294 CGI \uae30\ubc18\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \uc9d0<\/p>\n<p>* \ud604\uc7ac \uc2dc\uac01\uc744 \ub3cc\ub824\uc8fc\ub294 \uac04\ub2e8\ud55c Web Service Provider \uc791\uc131<\/p>\n<p>1. currentTime.h \u00a0 (\ud5e4\ub354\ud30c\uc77c \uc0dd\uc131)<\/p>\n<div class=\"txc-textbox\" style=\"background-color: #eeeeee; border-width: 1px; border-color: #eeeeee; border-style: solid; padding: 10px;\">\n<p style=\"margin: 0px;\">\n<p style=\"margin: 0px;\">\/\/ File: currentTime.h<\/p>\n<p style=\"margin: 0px;\">\/\/gsoap ns service name: currentTime<\/p>\n<p style=\"margin: 0px;\">\/\/gsoap ns service namespace: urn:currentTime<\/p>\n<p style=\"margin: 0px;\">\/\/gsoap ns service location: http:\/\/www.yourdomain.com\/currentTime.cgi<\/p>\n<p style=\"margin: 0px;\">int ns__currentTime(time_t&amp; response);<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p>&#8211; \u00a0\uc8fc\uc11d\uc5d0 \uc0ac\uc6a9\ub418\ub294 \ub0b4\uc6a9\uc740 \uc758\ubbf8\uac00 \uc788\uc74c<br \/>\n&#8211; ns\ub4a4\uc5d0 &#8216;__&#8217; \ub450\ubc88 \ud55c \ud6c4 \ud568\uc218 \uc791\uc131<\/p>\n<p>2. currentTime.cpp (\uc2e4\ud589 \ucf54\ub4dc \uc791\uc131)<br \/>\n1) object\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uc744 \uacbd\uc6b0<\/p>\n<div class=\"txc-textbox\" style=\"background-color: #eeeeee; border-width: 1px; border-color: #eeeeee; border-style: solid; padding: 10px;\">\n<p style=\"margin: 0px;\">\n<p style=\"margin: 0px;\">\/\/ File: currentTime.cpp<\/p>\n<p style=\"margin: 0px;\">#include &#8220;soapH.h&#8221; \/\/ include the generated declarations<\/p>\n<p style=\"margin: 0px;\">#include &#8220;currentTime.nsmap&#8221; \/\/ include the XML namespace mappings<\/p>\n<p style=\"margin: 0px;\">int main()<\/p>\n<p style=\"margin: 0px;\">{<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\/\/ create soap context and serve one CGI-based request:<\/p>\n<p style=\"margin-left: 4em;\">\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 8em;\">\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">return soap_serve(soap_new());<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px;\">\n<p style=\"margin: 0px;\">}\n<\/p>\n<p style=\"margin: 0px;\">int ns__currentTime(struct soap *soap, time_t&amp; response)<\/p>\n<p style=\"margin: 0px;\">{<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">response = time(0);<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">return SOAP_OK;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px;\">\n<p style=\"margin: 0px;\">}<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p>2) object\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0<\/p>\n<div class=\"txc-textbox\" style=\"background-color: #eeeeee; border-width: 1px; border-color: #eeeeee; border-style: solid; padding: 10px;\">\n<p style=\"margin: 0px;\">\n<p style=\"margin: 0px;\">\/\/ File: currentTime.cpp<\/p>\n<p style=\"margin: 0px;\">#include &#8220;soapcurrentTimeService.h&#8221; \/\/ include the proxy declarations<\/p>\n<p style=\"margin: 0px;\">#include &#8220;currentTime.nsmap&#8221; \/\/ include the XML namespace mappings<\/p>\n<p style=\"margin: 0px;\">int main()<\/p>\n<p style=\"margin: 0px;\">{<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin: 0px;\">\/\/ create server and serve one CGI-based request:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin: 0px;\">currentTimeService server;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin: 0px;\">return server.serve();<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px;\">\n<p style=\"margin: 0px;\">}\n<\/p>\n<p style=\"margin: 0px;\">int currentTimeService::currentTime(time_t&amp; response)<br \/>\n{<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4em;\">\n<p style=\"margin: 0px;\">response = time(0);<\/p>\n<p style=\"margin: 0px;\">return SOAP_OK;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px;\">\n<p style=\"margin: 0px;\">}<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<p>* stand-alone(non-multithreaded)\uc11c\ubc84\ub97c \ub3cc\ub9ac\uace0 \uc2f6\uc740 \uacbd\uc6b0 main\ud568\uc218\uc5d0\uc11c return currentTimeService.run(8080);\uc73c\ub85c \ubcc0\uacbd<\/p>\n<p>3. \uc11c\ubc84\uc6a9 SOAP \uc791\ub3d9\uc744 \uc704\ud55c \ucf54\ub4dc \uc0dd\uc131<br \/>\n1) \uc55e\uc5d0\uc11c object\ub97c \uc0ac\uc6a9\ud558\uc9c0 \uc54a\ub294 \uacbd\uc6b0<br \/>\n&gt; soapcpp2 -S currentTime.h<br \/>\n2) \uc55e\uc5d0\uc11c object\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0<br \/>\n&gt; soapcpp2 -c -S currentTime.h<\/p>\n<p>* &#8216;-c&#8217; \uc635\uc158\uc744 \uc0ac\uc6a9\ud558\uba74 c\ucf54\ub4dc\ub85c \uc11c\ubc84\ucf54\ub4dc\uac00 \uc0dd\uc131\ub428<\/p>\n<p>4. CGI binary\ub85c \ucef4\ud30c\uc77c<br \/>\n&gt; c++ -o currentTime.cgi currentTime.cpp soapC.cpp soapServer.cpp -lgsoap++<\/p>\n<p>5. cgi \ud30c\uc77c \ud14c\uc2a4\ud2b8<br \/>\n.\/currentTime.cgi &lt; currentTime.currentTime.req.xml<\/p>\n<p>[1] Robert van Engelen, &#8220;gSOAP 2.8.3 User Guide&#8221;, GENIVIA INC, June 24, 2011, p11~14<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ubcf8 \ubb38\uc11c\ub294 gSOAP User Guide[1]\ub97c \uae30\ubc18\uc73c\ub85c \ud574\uc11c \uc791\uc131\ud558\uc600\uc74c. &#8211; gSOAP\uc73c\ub85c \uad6c\ud604\ub41c WS Provider\ub294 CGI \uae30\ubc18\uc73c\ub85c \ub9cc\ub4e4\uc5b4 \uc9d0 *<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[44],"tags":[118,120],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-computer-etc","tag-gsoap-ko","tag-web-servce-ko"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gT1J-Q","_links":{"self":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":2,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":259,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/posts\/52\/revisions\/259"}],"wp:attachment":[{"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jinukbaek.com\/blog\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}