<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hackerdude &#187; C++</title>
	<atom:link href="http://www.hackerdude.com/category/dev-platforms/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackerdude.com</link>
	<description>Software Development Blog by David Martinez</description>
	<lastBuildDate>Fri, 17 Sep 2010 18:31:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Fast Web Services Client with C++Builder Pro</title>
		<link>http://www.hackerdude.com/2002/06/20/fast-web-services-client-with-cbuilder-pro/</link>
		<comments>http://www.hackerdude.com/2002/06/20/fast-web-services-client-with-cbuilder-pro/#comments</comments>
		<pubDate>Thu, 20 Jun 2002 04:50:04 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[CBBTR]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2002/06/20/fast-web-services-client-with-cbuilder-pro/</guid>
		<description><![CDATA[So here's the lowdown on how to get a web services client extremely quickly with C++ Builder Pro. 1.- The WSDL Figure out a WSDL you want to implement. You could use the ASP Web Matrix project to create the simplest C# web service with add of two numbers. 2.- The UI So we start [...]]]></description>
			<content:encoded><![CDATA[<p>So here's the lowdown on how to get a web services client extremely quickly with C++ Builder Pro. <span id="more-413"></span></p>
<p><b>1.- The WSDL</b><br />
Figure out a WSDL you want to implement. You could use the <a HREF="http://www.asp.net/webmatrix/">ASP Web Matrix project</a> to create the simplest C# web service with add of two numbers.</p>
<p><b>2.- The UI</b><br />
So we start with a typical empty project. Drop 2 Edit boxes and a statusbar with one status panel in it. Drop a button called "Call my webservice" or something hokey like that.</p>
<p><b>3.- Creating the C++ Client stubs</b><br />
Call File->New->Other->Web Services->WSDL importer, and #include the header file in your form.</p>
<p><b>4.- Preparing a Client endpoint</b><br />
Drop a THttpPrio component from the WebServices palette. Select your WSDL location (if you made the WebService using ASP.net, it will be something like http://localhost/MyClass.asmx?WSDL ). Select your service (MyClass) and your SOAP port (MyClassSoap).</p>
<p><b>5.- Tying it all together</b><br />
Double click on the button to generate an onClick() event. Now type something along the lines of:</p>
<pre class="cpp">&nbsp;
&nbsp;
        String sNumber1 = edtNumber1-&gt;Text;
        String sNumber2 = edtNumber2-&gt;Text;
        <span style="color: #0000ff;">int</span> firstNumber = StrToInt<span style="color: #000000;">&#40;</span>sNumber1<span style="color: #000000;">&#41;</span>;
        <span style="color: #0000ff;">int</span> secondNumber = StrToInt<span style="color: #000000;">&#40;</span>sNumber2<span style="color: #000000;">&#41;</span>;
&nbsp;
        <span style="color: #ff0000;">// To obtain this, we called</span>
        <span style="color: #ff0000;">// File-&gt;New-&gt;Other-&gt;Web Services-&gt;WSDL importer, and</span>
        <span style="color: #ff0000;">// #included the header file.</span>
        _di_MyClassSoap soapClass;
        myClassHttpPrio-&gt;QueryInterface<span style="color: #000000;">&#40;</span>soapClass<span style="color: #000000;">&#41;</span>;
        <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span> soapClass <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                <span style="color: #0000ff;">int</span> myResult = soapClass-&gt;Add<span style="color: #000000;">&#40;</span>firstNumber, secondNumber<span style="color: #000000;">&#41;</span>;
                String myMessage = <span style="color: #666666;">&quot;Result: &quot;</span> + IntToStr<span style="color: #000000;">&#40;</span>myResult<span style="color: #000000;">&#41;</span>;
                statusBar-&gt;Panels-&gt;Items<span style="color: #000000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #000000;">&#93;</span>-&gt;Text = myMessage;;
        <span style="color: #000000;">&#125;</span>
&nbsp;</pre>
</p>
<p>Done! You have a web service, go back to your server side and make C# multiply instead <img src='http://www.hackerdude.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The point is, with this technology, <b>no matter what the language is</b>, the barrier of entry is extremely low. Do make sure you get a modern implementation for the language though (so you will have at least client tools). I've been going through the internals and the whole thing only looks trivial. <img src='http://www.hackerdude.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2002/06/20/fast-web-services-client-with-cbuilder-pro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

