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

BearerToken.ObtainToken() API call causes exception

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
  • BearerToken.ObtainToken() API call causes exception
Options
  • Subscribe to RSS Feed
  • 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
Solved Go to Solution
Back to SmartConnector Forum
Solved
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 04:11 AM

0 Likes
15
2178
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 04:11 AM

BearerToken.ObtainToken() API call causes exception

Hi,

 

We are using a SmartConnector end-point and the code below.

When we call this API, an exception is shown in the SmartConnector log file. See attached.

Any idea why?

 

public static int ObtainBearerToken ()
{
_bearerToken = null;
try
{
// Obtain Token
Uri uri = new Uri(Settings.m_strURL);
_log.InfoFormat("ObtainBearerToken uri = '{0}', user = '{1}', pass = '{2}'", uri.ToString(), Settings.m_strUser, Settings.m_strPassword);
_bearerToken = BearerToken.ObtainToken(uri, Settings.m_strUser, Settings.m_strPassword, "GetToken");
if (_bearerToken == null)
{
_log.ErrorFormat("ObtainBearerToken fail, token is empty or null");
return -4; // invalid token
}
_log.InfoFormat("ObtainBearerToken pass, token = '{0}'", _bearerToken.ToString());
return 0;
}
catch (Exception ex)
{
_log.ErrorFormat("ObtainBearerToken, Exception, msg = '{0}'", ex.Message);
return -4;
}
}

 

Thank you.

 

Mike

Attachments
2022-04-10.log
Tags (1)
  • Tags:
  • english
Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-13 11:38 AM

0 Likes
1
2032
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-13 11:38 AM

Reinstalling the SmartConnector solved the problem. However, I suggest that this bug should be fixed.

Thanks.

 

Mike

See Answer In Context

Tags (1)
  • Tags:
  • english
Reply
Replies 15
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 04:18 AM

0 Likes
14
2174
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 04:18 AM

Hi,

 

One more thing. See the line below from the SmartConnector log file:

 

2022-04-10 14:13:34.1531,Error,EwsConsume,<no principal>,There was no endpoint listening at https://10.0.0.19/EcoStruxure/DataExchange that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.19:443

 

The IP address of our server has changed from 10.0.0.19 to 10.0.0.14. The log file still shows the old IP address (10.0.0.19).

 

Is it possible that this is causing the exception? 

Does SmartConnector keep the old IP address of my computer?

If yes, can we change it to the correct IP address?

 

Thanks.

 

Mike

 

 

 

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-10 10:23 PM

0 Likes
13
2113
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 10:23 PM

Hi Michael,

 

Yes, that is causing the exception. If the address of your EBO server changes you have to change it in your endpoint configuration.

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 10:27 PM

0 Likes
12
2111
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 10:27 PM

Hi Armend,

 

Thank you for your answer.

The Server Address in the endpoint is http://127.0.0.1:8019/EcoStruxure/DataExchange

 

The host is 127.0.0.1.

 

What should be the value assuming my IP address is 10.0.0.14?

 

Thank you.

 

Mike

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-10 10:41 PM

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

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

‎2022-04-10 10:41 PM

Hi,

 

Wherever it says 10.0.0.19, change it to 10.0.0.14

 

Screenshot below of the endpoint configuration: 

 

endpoint.png

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 10:53 PM

0 Likes
10
2105
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 10:53 PM

Hi Armend,

 

I have changed it (see attached screen capture) but SmartConnector log still shows the old IP address(10.0.0.19). See below.

 

2022-04-11 08:48:47.5495,Error,Processor,<no principal>,There was no endpoint listening at https://10.0.0.19/EcoStruxure/DataExchange that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.19:443

 

Please advise.

 

Thank you.

 

Mike

 

 

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 10:59 PM

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

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

‎2022-04-10 10:59 PM

Hi Armend,

 

One more thing.

 

My address is: 10.0.0.14:8019.

 

The address changes from 10.0.0.14 to 10.0.0.19 and the port changes from 8019 to 443. See below.

 

2022-04-11 08:56:14.5824,Error,EwsConsume,<no principal>,There was no endpoint listening at https://10.0.0.19/EcoStruxure/DataExchange that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.0.0.19:443

 

Any idea why?

 

Thanks,

 

Mike

 

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-10 11:06 PM

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

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

‎2022-04-10 11:06 PM

I think you might have forgotten to attach your screenshot

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 11:09 PM

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

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

‎2022-04-10 11:09 PM

Hi Armend,

 

See below.Screenshot 2022-04-11 090836.png

 

Thanks.

Mike

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-10 11:22 PM

0 Likes
6
2085
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 11:22 PM

Have you tried to 1. Stop and start the endpoint 2. Restart Smartconnector?

 

:443 is added by your system if you specify the https protocol in the connection string without an explicit port, so it seems it's not using the newest settings.

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-10 11:49 PM

0 Likes
5
2083
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-10 11:49 PM

Hi Armend,

 

Yes. I tried it. Same result.

 

Not sure I understood your answer below:

443 is added by your system if you specify the https protocol in the connection string without an explicit port, so it seems it's not using the newest settings.

 

What do you mean connection string? I don't see "Connection string" in the endpoint properties...

 

Thanks.

 

Mike

 

 

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-10 11:59 PM

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

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

‎2022-04-10 11:59 PM

I'm referring to the field called "server address", and it's just an general explanation  of why :443 would pop up.

 

Are there any other endpoints set up in Smartconnector that could be in conflict with this one, or maybe are used instead? If not, I would try removing the endpoint and trying to add a new with the same settings. I've never seen it get stuck like that.

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-11 01:44 AM

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

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

‎2022-04-11 01:44 AM

Hi Armend,

 

There was another endpoint but it was always was in "stopped" mode. I have deleted all endpoints and created a new one.

 

The same problem persists. It seems that the IP is stored inside SmartConnector database...

 

Do I need to uninstall SmartConnector and reinstall?

 

Thanks

 

Mike

 

 

 

 

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-11 05:41 AM

0 Likes
2
2060
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-11 05:41 AM

Yes, you could try reinstalling with a fresh database.

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
mike_meirovitz
Commander mike_meirovitz
Commander

Posted: ‎2022-04-13 11:38 AM

0 Likes
1
2033
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2022-04-13 11:38 AM

Reinstalling the SmartConnector solved the problem. However, I suggest that this bug should be fixed.

Thanks.

 

Mike

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-04-13 09:51 PM

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

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

‎2022-04-13 09:51 PM

I agree, let me know if it happens again.

 

BR

Armend

Tags (1)
  • Tags:
  • english
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