{"id":111,"date":"2005-12-31T09:53:07","date_gmt":"2005-12-31T13:53:07","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=111"},"modified":"2011-12-17T12:18:51","modified_gmt":"2011-12-17T16:18:51","slug":"doing-web-services-in-objective-c","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2005\/12\/doing-web-services-in-objective-c\/","title":{"rendered":"Doing Web Services in Objective C"},"content":{"rendered":"<p>The examples for web services in Objective C in Xcode 2 are pretty lame.  I am surprised that things are not cleaner &#8211; the WebKit is very sweet and cool.<br \/>\nI took one of the examples and refactored it to make it really cool.  I will post code in the blog in my next two posts.<br \/>\nThis is a mix of C++ and Objective C.  I am not an expert in either in Xcode2 having learned Xcode 4 days ago.  If someone smarter than me wants to redo this Apple event code using purely Objective C &#8211; that is fine with me.  I would actually like that refactored code.<br \/>\nThis is all Creative commons public domain &#8211; sample code stuff.  Use, tear up reuse, don&#8217;t sue me.<br \/>\nThis is the meat of host things are used again &#8211; note my weird dialect where I switch back form C, C++, and Objective C.  I am still a newbie and fall back to things I know like fprintf from time to time :)<\/p>\n<p><!--more--><br \/>\n\/\/ Java Signature in jws<br \/>\n\/\/    public String mymethod(String id, Integer i, Double d)<br \/>\nOSErr err;<br \/>\nAEDesc soapParms;<br \/>\nerr = createSoapParameters(&#038;soapParms);<br \/>\nerr = addSoapParameter(&#038;soapParms, &#8220;id&#8221;, typeChar, &#8220;fred&#8221;);<br \/>\nint i=25;<br \/>\nerr = addSoapParameter(&#038;soapParms, &#8220;i&#8221;, typeSInt32, &#038;i);<br \/>\ndouble d=123.456;<br \/>\nerr = addSoapParameter(&#038;soapParms, &#8220;d&#8221;, typeIEEE64BitFloatingPoint, &#038;d);<br \/>\nchar buffer[100000];<br \/>\nchar errorMessage[1024];<br \/>\nerr = makeSoapCall(url, &#8220;mymethod&#8221;, &#038;soapParms ,buffer, sizeof(buffer), errorMessage, sizeof(errorMessage), false, true);<br \/>\nAEDisposeDesc(&#038;soapParms);<br \/>\nif ( err == noErr ) {<br \/>\nfprintf(stderr,&#8221;Success String = %s!\\n\\n&#8221;, buffer);<br \/>\n} else {<br \/>\nfprintf(stderr,&#8221;Error String = %s!\\n\\n&#8221;, errorMessage);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The examples for web services in Objective C in Xcode 2 are pretty lame. I am surprised that things are not cleaner &#8211; the WebKit is very sweet and cool. I took one of the examples and refactored it to make it really cool. I will post code in the blog in my next two [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":2207,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/111\/revisions\/2207"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}