{"id":3311,"date":"2020-07-24T07:24:36","date_gmt":"2020-07-24T07:24:36","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3311"},"modified":"2020-07-24T07:26:19","modified_gmt":"2020-07-24T07:26:19","slug":"soap-using-printf","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/soap\/soap-using-printf","title":{"rendered":"SOAP using printf"},"content":{"rendered":"\n<p>Define the SOAP message<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define MY_SOAP_MESSAGE\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\"&lt;?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"\t\t\t\t\t\t\t\\\n\t\"&lt;v:Envelope xmlns:v=\\\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\\\" xmlns:c=\\\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\\\" xmlns:d=\\\"http:\/\/www.w3.org\/2001\/XMLSchema\\\" xmlns:i=\\\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\\\">\"\t\\\n\t  \"&lt;v:Header \/>\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\"&lt;v:Body>\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\t\"&lt;%s xmlns=\\\"%s\\\" id=\\\"o0\\\" c:root=\\\"1\\\">\"\t\t\t\t\t\t\\\n\t\t\t\t\"&lt;%s i:type=\\\"d:string\\\">\"\t\t\t\t\t\t\t\t\t\\\n\t\t\t\t\t\"&amp;lt;?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?&amp;gt;\"\t\t\\\n\t\t\t\t\t\"&amp;lt;request name=\\\"%s\\\"&amp;gt;\"\t\t\t\t\t\t\t\\\n\t\t\t\t\t\t\"&amp;lt;UserName&amp;gt;%s&amp;lt;\/UserName&amp;gt;\"\t\t\t\t\\\n\t\t\t\t\t\t\"&amp;lt;UserTag&amp;gt;%s&amp;lt;\/UserTag&amp;gt;\"\t\t\t\t\t\\\n\t\t\t\t\t\"&amp;lt;\/request&amp;gt;\"\t\t\t\t\t\t\t\t\t\t\\\n\t\t\t\t\"&lt;\/%s>\"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\t\"&lt;\/%s>\" \t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\t\"&lt;\/v:Body>\" \t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n\t\"&lt;\/v:Envelope>\"<\/code><\/pre>\n\n\n\n<p>Set the values within the message<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tchar buf&#91;1024];\n\n\tif (snprintf(buf, 1024, SOAP_MSG_TMPL, my_method, my_urn, my_elem, my_devid, my_user, uid, my_elem, my_method) &lt; 0)\n\t\treturn NULL;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Define the SOAP message Set the values within the message<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[160],"tags":[],"class_list":["post-3311","post","type-post","status-publish","format-standard","hentry","category-soap"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3311"}],"version-history":[{"count":2,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3311\/revisions"}],"predecessor-version":[{"id":3314,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3311\/revisions\/3314"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}