Have you ever tried to call a Web Service from .Net or Javascript ? It is pretty simple. Right? This is true if you are only doing GET requests without security. Things start to get complicated once your start using security and doing POST requests.
There are frameworks that make it easier, but even after you reduce the complexity by adding a library to handle Web Requests, parsing adds to the problem. Thinking about these two problem we designed an SDK for iKnode Applications that makes it extremely simple to execute from your client.
First, by handling ALL Web Requests without your client having to know about the security or how to do POST requests. Second it parses the results as as native C# classes or Javascript objects.
One very important aspect of the new SDK, is that you learn it once in any language, and you learn it for the rest. Right now we are only supporting C# and Javascript, but the Android and iOS SDKs are on the way and will be handled in the same way, focused completly on consitency.
It’s time to look at some code. Let’s say that we are building a User Service which is used to manage User information in the cloud:
usingSystem;usingiKnode.Applications;usingiKnodeSdk.UnitTest.Domain;namespaceiKnodeSdkTest{/// <summary>/// Defines the User Service./// </summary> [Application]publicclassUserService{/// <summary>/// Gets the User First Name by its identifier./// </summary>/// <param name="id">User Identifier.</param>/// <returns>User First Name/.</returns>publicstringGetFirstNameById(intid){return"Robert";}/// <summary>/// Gets the Most Common User First Name./// </summary>/// <returns>Most Common User First Name/.</returns>publicstringGetMostCommonFirstName(){return"John";}/// <summary>/// Gets the User by its identifier./// </summary>/// <param name="id">User Identifier.</param>/// <returns>User Information.</returns>publicUserGetById(intid){if(id!=1){returnnull;}returnnewUser(1,newFullName("John","Doe"));}/// <summary>/// Saves the User Information./// </summary>/// <param name="user">User Information.</param>/// <returns>User Identifier.</returns>publicintSave(Useruser){if(user==null){return-1;}//TODO: Here your store the User Information.returnuser.Id;}/// <summary>/// Creates a new User with the Default Information./// </summary>/// <returns>User Information.</returns> publicUserCreateDefault(){returnnewUser(2,newFullName("Jane","Doe"));}/// <summary>/// Creates a new User./// </summary>/// <param name="id">Identifier.</param>/// <param name="name">Name.</param>/// <returns>User Information.</returns> publicUserCreate(intid,FullNamename){returnnewUser(id,name);}}}
In this case we are going to have the following classes as part of the model to be shared by the service and the C# client. For the Javascript client the model is not required.
namespaceiKnodeSdkTest{/// <summary>/// Defines the Full Name class./// </summary> [Serializable]publicclassFullName{/// <summary>/// First Name./// </summary>publicstringFirstName;/// <summary>/// Last Name./// </summary>publicstringLastName;/// <summary>/// Initializes a new instance of the <see cref="FullName"/> class./// </summary>/// <param name="firstName">First Name/</param>/// <param name="lastName">Last Name.</param>publicFullName(stringfirstName,stringlastName){this.FirstName=firstName;this.LastName=lastName;}}/// <summary>/// Defines the User class./// </summary> [Serializable]publicclassUser{/// <summary>/// Identifier./// </summary>publicintId;/// <summary>/// Full Name./// </summary>publicFullNameName;/// <summary>/// Initializes a new instance of the <see cref="User"/> class./// </summary>/// <param name="id">Identifier.</param>/// <param name="name">Name.</param>publicUser(intid,FullNamename){this.Id=id;this.Name=name;}}}
Now in the C# client side, you would call the UserService in the following way:
C# Client
1234567891011
// Creating User Id 1 with Name jdoe.ApplicationClientuserSvc=newApplicationClient("https://api.iknode.com",UserId,ApiKey,"UserService");Useruser=userSvc.Execute<User>("Create",newMethodParameter("id",1),newMethodParameter("name","jdoe"));
Now in Javascript the same call would look like this:
We are launching at DEMO Fall 2012!!! Look for us in the Pavilion in kiosk S12. As part of the launch we have posted the pricing, a new website and a special offer: anybody that registers during the month of October will get November free as well. No credit card is required, so go ahead and just signup if you haven’t already.
We want to thank our Beta users, we really appreciate your feedback. All your data and applications will still be there, and you will get the rest of the year free.
Finally We also want to thank Microsoft for sponsoring us to launch at DEMO. We have been working with Microsoft’s technologies for the past 10 years, and we are proud to be part of the Bizspark program.
And with no further ado, here are some pictures of the event:
Today we are excited to introduce two really cool features: Dashboard Icons for Applications and an improved JSON Viewer for Query Console Results. Without further ado, let’s jump to the details:
Introducing Icons in the Dashboard
Applications can now have their own icon for the Dashboard. This will make it easy to find apps in the dashboard, while also making it beautiful. Choose from 152 beautifully crafted icons by IconDock.