Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

REST Web Service

SmartConnector Forum

Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • SmartConnector
  • SmartConnector Forum
  • REST Web Service
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
JeffBowman
Sisko JeffBowman Sisko
164
ardak
ardak Schneider Alumni (Retired)
34
sesa180908_brid
Commander sesa180908_brid Commander
34
mike_meirovitz
Commander mike_meirovitz
21
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to SmartConnector Forum
sesa450478_brid
sesa450478_brid Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2017-07-20 08:32 AM

1 Like
12
2034
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-20 08:32 AM

REST Web Service

Hi everyone: I created a REST Web Service using C# with Visual Studio, and i want to transfer this server in the Smart Connector. In the Web Service I created the methods GET, PUT, POST, DELETE and i used the class "System.Web.Http.APIController" under the main class. In visual studio the service (IIS) has port 59951, while the smart connector has another port (8082)

I compiled the code and moved the file.dll in the Smart Coonnector where i configured the Processor, but i have the following question:

1) How i can call this method in Smart Connector with a  REST client (for example Postman or Advanced REST Client)

2) Do I have to write on visual studio the port of smart connector?

3) How the smartconnector gets the topics from the REST client?

Thank you so much

Reply
  • All forum topics
  • Previous Topic
  • Next Topic
Replies 12
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-07-20 11:14 AM

0 Likes
11
1690
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-20 11:14 AM

SmartConnector doesn't use IIS at all.  Rather, SmartConnector utilizes the Owin stack to self host HTTP endpoints.  The port you are referring to (8082 by default) is actually the "Portal" port.  No request made to this could be routed to your controllers in any way.

SmartConnector also uses Owin to serve up "RESTful EWS Gateway" endpoints.  Which brings me to my recommendation.  The "RESTful EWS Gateway" is actually a specific implementation of SmartConnector's "REST Extension Framework".  And as such, SmartConnector developers are free to extend this framework to create your own custom endpoints. By using this approach, rather then direct "roll your own" approach, you will get the following benefits for free:

  • Endpoint hosting
  • Native support within SmartConnector Portal (e.g its configurable)
  • OAuth Bearer token authentication
  • Licensing
  • Swagger metadata feed with test page
  • Throttling

Unfortunately, we haven't yet fully documented the process into it's own Developer's Guide or as an Appendix to that.

I might be able to stub out a shell "Extension" and post it into the public GitHub samples project.  What is your time frame for implementation?  Is this just a proof of concept or an actual job?

Reply
sesa450478_brid
sesa450478_brid Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2017-07-25 06:54 AM

0 Likes
0
1690
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-25 06:54 AM

Thank you for help,

After your suggestion i've created a Server Rest OWIN and l compiled the code and moved the file.dll in the Smart Connector and it work.

Reply
sesa450478_brid
sesa450478_brid Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2017-07-26 08:30 AM

0 Likes
9
1690
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-26 08:30 AM

It is an actual job, that we want to transfer data between an external database and the ES. We have performed the work with OWIN and we have managed to activate the server from the smartconnector. Moreover, do you have any documentation on this part of OWIN?

I would like to ask you 2 more questions:

  1. When I start my OWIN Server with the following command "using (WebApp.Start <Startup> (url: MyUrl)) in the main class of the Smart Connector " IEnumerable <Prompt> Execute_Subclass ()”, I cannot stop the process in the Smart Connector interface when I want to. Do you have any suggestions?
  2. I have my own SQL database with historical data from 3rd party, and I want to have these historical data (Trend Log) on the Enterprise Server? Can I transfer data from my Database to the Smart Connector without losing the Real Timestamp? I saw that exists a "HistoryItem" method. Is the right way or it is not possible?

Thank you so much

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-07-26 10:30 AM

0 Likes
8
1690
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-26 10:30 AM

I'm seeing two separate issues here...

Issue #1

Since you are speaking of "Processor" and "WebApp.Start" you are still not using SmartConnector's "REST Extension Framework" as I referred to in my prior post on this thread.  Instead, you are taking over all apsects of the endpoint and standing it up from within a Processor.  While this is certainly a valid approach, it has many downsides as you now see.  Besides not having configuration, provisioning, auth, licensing, throttling, etc done for you by the framework (or perhaps you even duplicated effort in one or more of these areas), you also need to always have a Processor running for the sole purpose of keeping the endpoint alive.

I do realize that authoring your own REST Extension isn't well documented at this point.  This is why I inquired as to your timeframe and whether this was for a real job or not.  I was trying to gauge the urgency for posting an example to GitHub.

For now, you can continue the approach you are on but please make sure your Proccessor code looks like this:

        protected override IEnumerable<Prompt> Execute_Subclass()

        {

            using (WebApp.Start(url, configurationAction)) // url and configurationAction are as you have them now

            {

                do

                {

                    NoBusyWait(10, false);

                } while (!IsCancellationRequested); // This will allow the Processor to respond to STOP requests

            }

            return new List<Prompt>();

        }

Also, make sure that your Processor implements ILongRunningProcess.  Failure to do that, will result in the WorkerManager attempting to "kill" the Proccessor.

Issue #2

I read your question to mean you have data in some SQL DB/Tables that you want to serve as EWS data back to SBO.  There are two approaches you can use for this.

  • Custom EWS Server.  By implementing a custom EWS Server you can serve data directly from your database and not the one that comes with SmartConnector.  This is discussed in the SmartConnector Developers Guide section 4.2 as a "synchronous" custom server but the source is a database.  See also section 5.7 for an example on creating a custom EWS Server Extension.
  • Standard EWS Server.  In order to leverage the included standard EWS Server, you would need to take over pushing the data into the SmartConnector SQL tables yourself.  Using the EwsServerDataAdapter wouldn't work in this scenario because it handles aspects such as creating history automatically for you.
Reply
sesa450478_brid
sesa450478_brid Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2017-07-28 01:30 AM

0 Likes
7
1690
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-28 01:30 AM

Thanks for your help.

It is a real job application and we have to do this work for three different installations required for 3 european projects we are currently participating:

1) http://www.buildheat.eu/

2) http://www.thermoss.eu/

3) http://www.pentagon-project.eu/

In each project we are deploying a server for real time and historical exchange of data between the ES, through smartconnector (with our custom methods GET,PUT,POST,DELETE),  and the applications of other partners using REST API over JSON structure .

The application in one of these projects is pretty urgent, so we think we will continue with the existing approach and when you can provide us documentation or an example to GitHub we will create the Server with "REST Extension Framework".

Do you think that moving from my Server (with OWIN) to Server with REST Extension Framework it takes a lot of time?

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-07-28 05:21 AM

1 Like
6
1690
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-07-28 05:21 AM

The amount of time required to switch over to the REST Extension Framework should be minimal.  Almost all of your controller code will be directly portable.  I will post to this forum when the samples and documentation are available.

Reply
sesa450478_brid
sesa450478_brid Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2017-09-19 07:17 AM

0 Likes
4
1689
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-09-19 07:17 AM

Hello Mark,

I would like to ask you if the samples and documentation to the "REST Extension Framework" are availabe.

Thank you so much

Reply
Benji
Administrator Benji Administrator
Administrator

Posted: ‎2017-09-19 07:21 AM

0 Likes
3
1689
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-09-19 07:21 AM

SmartConnector RESTful EWS Gateway.pdf 

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-09-19 07:28 AM

1 Like
2
1689
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-09-19 07:28 AM

Benjamin,

I believe Michele was looking for information/samples on how to consume the REST Extension framework to author a custom REST API in SmartConnector (not specifically the existing Providers).

Michele,

That won't be available until after the SmartConnector 2.3 release (Q4 2017).

Reply
Benji
Administrator Benji Administrator
Administrator

Posted: ‎2017-09-19 07:31 AM

0 Likes
0
1689
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-09-19 07:31 AM

Thanks, missed that though it's obvious now.

Reply
sesa450478_brid
sesa450478_brid Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2017-10-24 12:19 AM

1 Like
0
1689
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-10-24 12:19 AM

Hello Mark,

The job for the project is very urgent, so we will continue with the existing approach and when you can provide us documentation or an example to GitHub we will create the Server with "REST Extension Framework".

To make it easier the "transition" from Server (OWIN) to Server with REST Extension Framework, you could give me an example or advice on implementing the "safe comunication" (OAuth Bearer Token Authentication).

Thank you so much

Michele

Reply
Adam_Summers
Lt. Commander Adam_Summers Lt. Commander
Lt. Commander

Posted: ‎2017-11-14 07:20 AM

0 Likes
0
1689
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-11-14 07:20 AM

Hi Mark,

We are about to embark on a new project where we need to set up a really simple REST Api Endpoint, probably just one route to send an email. We were thinking of using the Custom Endpoint feature. I've been having a look at the code classes but can't see how to get started. Would you have a simple class example or code stub to show how to create a custom endpoint? I presume we do not need an EWS Server as part of the configuration?

Chrystalla Ioannou​

Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of