9 Replies Latest reply on Aug 23, 2012 2:09 PM by Lonnie Bowling

    PI to Mobile Part 2 Blog is up!

    Lonnie Bowling

      It took a lot more work than I expected to make the video, but this is a great way for me to learn and share, so it is worth it. I hope you find it interesting.

       

      Here it is!

       

      Lonnie

        • Re: PI to Mobile Part 2 Blog is up!

          For those who want to access the API, it's http://giant.cloudapp.net/api/values/cdt158?range=-4 rather than http://gaint.cloudapp.net/api/values/cdt158?range=-4 like in the video (Lonnie meant "giant" but typed "gaint").

           

          @Lonnie: we were considering something similar for one of our customers but were thinking about the Open Data (OData) protocol. Are you familiar with this type of REST web services and have you considered it for this project? If you did, can you say a few words about why you think the approach you ended up using is better?

           

          Also, have you given any thought to how you would go after security in a real-world scenario?

            • Re: PI to Mobile Part 2 Blog is up!
              Lonnie Bowling

              Hi Michael,

               

              Thanks for clarifying the URL.  I get a little excited when deploying stuff to Azure, lol.

               

              I don't have any direct OData experience, but when looking at my options it seemed that OData was focused on converting a SQL datasource via Entity Framework to a REST API.  The end result is what really counts for mobile, so I would think that OData would be a good choice depending on where your skills are.   I have used Entity Framework with Silverlight and it became pretty complicate fairly fast, that might have been why I didn't go that route.  Plus the PI system is not really a SQL type of data source (PI OLEDB Enterprise could be used, but it only offers read support right now).

               

              I think I went with ASP.Net Web API because it is so simple and I needed to get something working fast as I really wanted to focus on the mobile side.  As far as securing the client, I'm going to be working on a claims based OAuth2 solution.  It think Web API should be able to handle that as it is using ASP.Net as a backbone.  I hope to get that working when I have a bit more time, as I'm really interested on how that would look across multiple platforms.

               

              I think long term OSIsoft will provide the data access we need, but if you have to do something now, then these are important considerations.  For me, it comes down to what I know I can do and what I think I can pickup fairly fast to get the work done.   Keep in mind that ASP.Net Web API was just promoted to RC.

               

              vCampus 2010 has a great presentation on OData by Steve Pilon and Michael van der Veeken you should check out if you have not seen it.  It is here.

               

              Hope that kinda answered your questions.  Let us know what you decide on, it would be good for us to share our experiences.

               

               

               

              Lonnie

                • Re: PI to Mobile Part 2 Blog is up!

                  Well, relational data sources and Entity Framework are just one the several ways to implement an OData web service - you could very well use different techniques, each requiring different amounts of coding. As you say, the end result is what really counts for mobile - and the nice thing about OData is that it offers a known & discoverable syntax (as opposed to an arbitrary one) and that, consequently, several client libraries, APIs and SDKs exist to make use of it (including the 3 types of devices you plan to cover in your series).

                   

                  From a security standpoint, it is recommended to protect OData services using OAuth too.But the real question though - sorry, I should have made that clearer - is what kind of security do people/organizations want to secure their data (not developers). Do they want plain username/password? Facebook/Twitter/Live kind of authentication?

                   

                  Lonnie Bowling

                  I think long term OSIsoft will provide the data access we need ... vCampus 2010 has a great presentation on OData by Steve Pilon and Michael van der Veeken you should check out if you have not seen it.
                  Yeah, I saw the presentation and I can't wait to get that OData web service from OSIsoft directly

                    • Re: PI to Mobile Part 2 Blog is up!

                      Michael Gibson

                      From a security standpoint, it is recommended to protect OData services using OAuth too.But the real question though - sorry, I should have made that clearer - is what kind of security do people/organizations want to secure their data (not developers). Do they want plain username/password? Facebook/Twitter/Live kind of authentication?
                      WIF: ADFS

                       

                      Michael Gibson

                      Lonnie Bowling

                      I think long term OSIsoft will provide the data access we need ... vCampus 2010 has a great presentation on OData by Steve Pilon and Michael van der Veeken you should check out if you have not seen it.
                      Yeah, I saw the presentation and I can't wait to get that OData web service from OSIsoft directly
                      I am waiting for this too. Steve P and co. only have to write a few lines of code for an OData interface (to translate to PI Data Services calls)

                        • Re: PI to Mobile Part 2 Blog is up!

                          Rhys @ Wipro

                          I am waiting for this too. Steve P and co. only have to write a few lines of code for an OData interface (to translate to PI Data Services calls)
                          Yeah, it's that easy... should have something to release in the next couple days...

                           

                          No, seriously, we are making progress on an OData offering as we speak and we will have a few exciting things to communicate and show at vCampus Live! 2012 at the end of November. We are approaching a few individuals who expressed interest in the topic over time, to help validate and refine our vision - and I kindly invite folks on this community to contact me in private at spilon@osisoft.com, if you have interest/needs/use cases/projects around REST web services and OData.

                            • Re: PI to Mobile Part 2 Blog is up!
                              Lonnie Bowling

                              Hi Everyone,

                               

                              Sorry it is taking so long to get the next video up.  I have had a few real-life issues that are now resolved and will allow me to get back on track.  I'm about 60% completed with my iPhone application and might be ready to shoot this weekend.  This is the big payoff after doing all the backend work!

                               

                              Speaking of backend work (I know, that does not sound good), I found this very cool post about ASP.Net Web API and OData.  Apparently it is super easy to get this working!  Here is the link to a short blog post outlining how to do it.

                               

                              I am going to have to try it out when I'm ready to expand my current api. I love this stuff I feel like the curiosity mars rover as I explore!!

                               

                              Lonnie

                          • Re: PI to Mobile Part 2 Blog is up!
                            Lonnie Bowling

                            Great points.  I wonder how to get OData working with a service bus.  I know about the SDK support, but to tell you the truth, I'm a bit shy about trusting Microsoft to support other platforms on the client side.  When you starting having problems with SDKs then it really sucks.  That being said, I would have no issues with trying an SDK if it made live much easier.

                             

                            On the security side, I think that basic username/passwords have to have some identity provider to back them up, like AD or the others you mention.  That is what makes claims based security so nice, each customer can decide what they want to use and you can still get the client authenticated.  I think ADFS is going to be the route most will go when working with PI systems.  Most of my discussion with clients have gone that way.

                             

                             

                             

                            Lonnie

                             

                             

                             

                            @Rhys I didn't see your post until I posted, I see we both agree on ADFS, great minds think alike :)

                              • Re: PI to Mobile Part 2 Blog is up!

                                @Rhys and Lonnie: you wrote WIF/ADFS... I'm not very familiar with this aspect (that's why I asked in the first place!), but doesn't that preclude securing connections to iOS, Android, etc. devices?

                                 

                                Lonnie Bowling

                                 I wonder how to get OData working with a service bus.
                                Microsoft's own implementation of OData is "WCF Data Service", so I am assuming you should be able to add one of those when you add a Windows Cloud Service (around 1:15 in your 2B video). Never tried it myself, but I can't think of any reason why it wouldn't work.

                                 

                                Lonnie Bowling

                                know about the SDK support, but to tell you the truth, I'm a bit shy about trusting Microsoft to support other platforms on the client side.
                                Well it's not really Microsoft adding support for other platforms... they helped defined what OData is in the first place, but then it becomes a simple, RESTful AtomPub or JSON feed which anybody can parse or create libraries for. Take the odata4j library for instance (this what you would use to consume OData from an Android device)... it's an open source library you can find here.

                                 

                                 

                                  • Re: PI to Mobile Part 2 Blog is up!
                                    Lonnie Bowling

                                    Hi Michael,

                                     

                                    OK, it sounds like connecting it to a servicebus would work, but now I have to figure out how to get it out to the client.  I could have the client connect directly to the other end of the service bus but I don't really like that for a couple of reasons. I like having control of the client at the clould level, this will allow me to manage accounts and add any business logic or other cool stuff.  I can also meter the traffic to the on-prim PI server if I had a lot of clients.  Anyway, I will have to think about it a bit more.  Thanks for bringing it up and providing some ideas!

                                     

                                    Sorry, ADFS is Active Directory Federation Service.  It is an additional install from Microsoft that will allow any AD to be an identity provider.  Azure ACS (access control service) can then use this to authenicate users.

                                     

                                    Lonnie