<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9000506279629129599</id><updated>2024-10-04T19:03:28.843-07:00</updated><title type='text'>Web Api Services</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://webapiservices.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://webapiservices.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07725042225303796840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9000506279629129599.post-1194709973755614955</id><published>2012-07-14T06:33:00.000-07:00</published><updated>2012-07-14T06:39:43.514-07:00</updated><title type='text'>Kanga api</title><content type='html'>&lt;a href=&quot;https://kangapi.codeplex.com/&quot;&gt;yup, I&#39;m done with it. The kanga api project has started.&lt;/a&gt;

It has been quite easy to play with &lt;a href=&quot;http://kangamodeling.codeplex.com/&quot;&gt;this modeling platform published on CodePlex&lt;/a&gt;.

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://farm9.staticflickr.com/8007/7567731492_6cc7d852c3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;257&quot; width=&quot;500&quot; src=&quot;http://farm9.staticflickr.com/8007/7567731492_6cc7d852c3.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

It&#39;s a nice project and they also expose an api in order to provide a services based software.
But for educational purpose I&#39;ve been playing around with the code and embedded it in an MVC4 Web Api project.
&lt;br/&gt;
Also provided a method to visualize the diagram as encoded base64 background image. I&#39;m still working on this. Not sure why the image doesn&#39;t show up, it could be a different way to encode it through my c# class</content><link rel='replies' type='application/atom+xml' href='http://webapiservices.blogspot.com/feeds/1194709973755614955/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://webapiservices.blogspot.com/2012/07/kanga-api.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default/1194709973755614955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default/1194709973755614955'/><link rel='alternate' type='text/html' href='http://webapiservices.blogspot.com/2012/07/kanga-api.html' title='Kanga api'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07725042225303796840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9000506279629129599.post-6978344269773853077</id><published>2012-07-12T08:34:00.000-07:00</published><updated>2012-07-12T08:55:21.885-07:00</updated><title type='text'>RGraphWebApi instructions #1</title><content type='html'>First of all you should understand two things.
&lt;ul&gt;
&lt;li&gt;
we need to automatize the way data ara loaded. Of course you can get your data from a db or any other repository but it was quite natural to me consider csv as the basic structure out of which data could be displayed. (the folder -repository- is App_Data\Series)
&lt;/li&gt;
&lt;li&gt;
the structure is this:
&lt;ul&gt;
&lt;li&gt;
we do have a header, that is not accounted while the data are loaded by the application
&lt;br/&gt;
&lt;b&gt;X;Y;XLabel;YLabel;Notes&lt;/b&gt;
&lt;/li&gt;
&lt;li&gt;
and rows of data according to the header
&lt;br/&gt;
12,00;;Jan;;notes for january
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
Now how do we go from this?
It&#39;s quite simple:
&lt;br/&gt;
we do have a class that has a property collection of DataPoint; 
&lt;br/&gt;
the property is called 
&lt;strong&gt;public &lt;span class=&quot;blue&quot;&gt;List&lt;/span&gt; &amp;lt;&lt;span class=&quot;blue&quot;&gt;DataPoint&lt;/span&gt; &amp;gt; SeriesPoints&lt;/strong&gt;
and can you guess what a DataPoint is?&lt;br/&gt;
Well, you can judge for yourself:

&lt;br/&gt;
  &lt;span class=&quot;blue&quot;&gt; public&lt;/span&gt; &lt;span class=&quot;azure&quot;&gt; class&lt;/span&gt; DataPoint&lt;br/&gt;
    {&lt;br/&gt;
        [Required]&lt;br/&gt;
        &lt;span class=&quot;blue&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;azure&quot;&gt;decimal&lt;/span&gt; X { get; set; }&lt;br/&gt;
        &lt;span class=&quot;blue&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;azure&quot;&gt;decimal?&lt;/span&gt; Y { get; set; }&lt;br/&gt;
        [Required]&lt;br/&gt;
        &lt;span class=&quot;blue&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;azure&quot;&gt;string&lt;/span&gt; XLabel { get; set; }&lt;br/&gt;
        &lt;span class=&quot;blue&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;azure&quot;&gt;string&lt;/span&gt; YLabel { get; set; }&lt;br/&gt;
        &lt;span class=&quot;blue&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;azure&quot;&gt;string&lt;/span&gt; Notes { get; set; }&lt;br/&gt;
    }&lt;br/&gt;

&lt;h1&gt;Elementary my dear Watson!!!&lt;/h1&gt;

&lt;style type=&quot;text/css&quot;&gt;
.azure

{

color:azure;  font-weight: bold;

}
.blue

{

color:blue;  font-weight: bold;

}

.green

{

color:green;  font-weight: bold;

}

.code

{

  font-family: &quot;Segoe UI&quot;, Verdana, Helvetica, Sans-Serif;

 font-weight: bold;

}
&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://webapiservices.blogspot.com/feeds/6978344269773853077/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://webapiservices.blogspot.com/2012/07/rgraphwebapi-instructions-1.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default/6978344269773853077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default/6978344269773853077'/><link rel='alternate' type='text/html' href='http://webapiservices.blogspot.com/2012/07/rgraphwebapi-instructions-1.html' title='RGraphWebApi instructions #1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07725042225303796840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9000506279629129599.post-3184754143680861696</id><published>2012-07-10T06:06:00.001-07:00</published><updated>2012-07-10T06:34:54.579-07:00</updated><title type='text'>Web Api default xml formatter.</title><content type='html'>The default formatter in the &lt;a target=&quot;_blank&quot; href=&quot;http://www.asp.net/web-api&quot;&gt;Mvc web api&lt;/a&gt; is an XML formatter.&lt;br /&gt;
To disable it, it&#39;s necessary to remove it from the default formatters.&lt;br /&gt;
In the Global.asax.cs (if we talk c#) you should add these lines of code:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5kNVPji5HneVfSAP3RnacUvN3Ay0C41Pzg55GjSudW_C8GDwhpz3WFRV-NzjK2fIDhWE2v1JAdYMiw5AlwdObF56C-s0WeI6dPkP9nxRUICpb_Jix-N1apeFDaqROfs5oYM-OwOv0dns/s1600/web_api1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5kNVPji5HneVfSAP3RnacUvN3Ay0C41Pzg55GjSudW_C8GDwhpz3WFRV-NzjK2fIDhWE2v1JAdYMiw5AlwdObF56C-s0WeI6dPkP9nxRUICpb_Jix-N1apeFDaqROfs5oYM-OwOv0dns/s400/web_api1.png&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;blockquote class=&quot;code&quot;&gt;
&lt;span class=&quot;green&quot;&gt; // The Web API Configuration Object&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;blue&quot;&gt; var&lt;/span&gt; config = GlobalConfiguration.Configuration;

&lt;br /&gt;
&lt;span class=&quot;green&quot;&gt;  // Remove the XML Formatter&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;blue&quot;&gt; var&lt;/span&gt; xmlFormatter = config.Formatters&lt;br /&gt;
.Where(f =&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;blue&quot;&gt; return&lt;/span&gt; f.SupportedMediaTypes.Any(v =&amp;gt; v.MediaType == &quot;text/xml&quot;);&lt;br /&gt;
})&lt;br /&gt;
.FirstOrDefault();&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;blue&quot;&gt;   if&lt;/span&gt; (xmlFormatter !=   &lt;span class=&quot;blue&quot;&gt;  null&lt;/span&gt;)&lt;br /&gt;
{&lt;br /&gt;
config.Formatters.Remove(xmlFormatter);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;style type=&quot;text/css&quot;&gt;
.blue

{

color:blue;  font-weight: bold;

}

.green

{

color:green;  font-weight: bold;

}

.code

{

  font-family: &quot;Segoe UI&quot;, Verdana, Helvetica, Sans-Serif;

 font-weight: bold;

}
&lt;/style&gt;</content><link rel='replies' type='application/atom+xml' href='http://webapiservices.blogspot.com/feeds/3184754143680861696/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://webapiservices.blogspot.com/2012/07/web-api-default-xml-formatter.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default/3184754143680861696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9000506279629129599/posts/default/3184754143680861696'/><link rel='alternate' type='text/html' href='http://webapiservices.blogspot.com/2012/07/web-api-default-xml-formatter.html' title='Web Api default xml formatter.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07725042225303796840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5kNVPji5HneVfSAP3RnacUvN3Ay0C41Pzg55GjSudW_C8GDwhpz3WFRV-NzjK2fIDhWE2v1JAdYMiw5AlwdObF56C-s0WeI6dPkP9nxRUICpb_Jix-N1apeFDaqROfs5oYM-OwOv0dns/s72-c/web_api1.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>