<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Using the API: Advertise on my site</title>
	<atom:link href="http://blog.openx.org/11/using-the-api-advertise-on-my-site/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.openx.org/11/using-the-api-advertise-on-my-site/</link>
	<description>OpenX Community News</description>
	<pubDate>Tue, 24 Nov 2009 13:29:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: hertzel</title>
		<link>http://blog.openx.org/11/using-the-api-advertise-on-my-site/#comment-57864</link>
		<dc:creator>hertzel</dc:creator>
		<pubDate>Tue, 04 Nov 2008 13:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.openx.org/?p=744#comment-57864</guid>
		<description>Thanks for Sharing, the only thing that I see is that you have to use openx alongside with this...  I'm something similar  and here is a piece of it using ZendFramework.. and without the openX helpers

[code]
set_include_path(get_include_path(). PATH_SEPARATOR . dirname(dirname(__FILE__)) . '/library');
require_once   "Zend/XmlRpc/Client.php";
require_once	"constants.php";

private function connect($requestUrl) {
		//Establish Connection
		$this-&#62;con = new Zend_XmlRpc_Client(OX_URL . $requestUrl . ".php");
	}

	/**
	 * Initialize a server connection with the XmlRpc Service
	 * @param $user string user name
	 * @param $password string user password
	 * @return string phpads session token
	 */
	function login($user, $password) {
		//Call service
		$this-&#62;connect ( 'LogonXmlRpcService' );

		//Initialice Session handler
		$this-&#62;session  = $this-&#62;con-&#62;call('logon', array (
		new Zend_XmlRpc_Value_String($user),
		new Zend_XmlRpc_Value_String($password),
		));

		if ($this-&#62;session) {
			return $this-&#62;session;
		} else {
			return false;
		}
	}

//And then some advertiser fun

$this-&#62;connect( 'AdvertiserXmlRpcService' );
	
	//Here we create an empty advertiser without any users
	//@TODO: Add Advertiser validation
	$advertiserId = $this-&#62;con-&#62;call('addAdvertiser',array(
			new Zend_XmlRpc_Value_String($this-&#62;session),
			new Zend_XmlRpc_Value_Struct(array(
				"advertiserName"  =&#62; $input['clientCompany'],
				"agencyId"		  =&#62; DEFAULT_MANAGER //Default Agency
			))
		));


Hope this helps!!!</description>
		<content:encoded><![CDATA[<p>Thanks for Sharing, the only thing that I see is that you have to use openx alongside with this&#8230;  I&#8217;m something similar  and here is a piece of it using ZendFramework.. and without the openX helpers</p>
<p>[code]<br />
set_include_path(get_include_path(). PATH_SEPARATOR . dirname(dirname(__FILE__)) . &#8216;/library&#8217;);<br />
require_once   &#8220;Zend/XmlRpc/Client.php&#8221;;<br />
require_once	&#8220;constants.php&#8221;;</p>
<p>private function connect($requestUrl) {<br />
		//Establish Connection<br />
		$this-&gt;con = new Zend_XmlRpc_Client(OX_URL . $requestUrl . &#8220;.php&#8221;);<br />
	}</p>
<p>	/**<br />
	 * Initialize a server connection with the XmlRpc Service<br />
	 * @param $user string user name<br />
	 * @param $password string user password<br />
	 * @return string phpads session token<br />
	 */<br />
	function login($user, $password) {<br />
		//Call service<br />
		$this-&gt;connect ( &#8216;LogonXmlRpcService&#8217; );</p>
<p>		//Initialice Session handler<br />
		$this-&gt;session  = $this-&gt;con-&gt;call(&#8217;logon&#8217;, array (<br />
		new Zend_XmlRpc_Value_String($user),<br />
		new Zend_XmlRpc_Value_String($password),<br />
		));</p>
<p>		if ($this-&gt;session) {<br />
			return $this-&gt;session;<br />
		} else {<br />
			return false;<br />
		}<br />
	}</p>
<p>//And then some advertiser fun</p>
<p>$this-&gt;connect( &#8216;AdvertiserXmlRpcService&#8217; );</p>
<p>	//Here we create an empty advertiser without any users<br />
	//@TODO: Add Advertiser validation<br />
	$advertiserId = $this-&gt;con-&gt;call(&#8217;addAdvertiser&#8217;,array(<br />
			new Zend_XmlRpc_Value_String($this-&gt;session),<br />
			new Zend_XmlRpc_Value_Struct(array(<br />
				&#8220;advertiserName&#8221;  =&gt; $input['clientCompany'],<br />
				&#8220;agencyId&#8221;		  =&gt; DEFAULT_MANAGER //Default Agency<br />
			))<br />
		));</p>
<p>Hope this helps!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
