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

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

Unable to create EwsClient instance

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
  • Unable to create EwsClient instance
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
sesa145614_brid
Ensign sesa145614_brid Ensign
Ensign

Posted: ‎2017-02-24 03:13 PM

0 Likes
3
784
  • 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-02-24 03:13 PM

Unable to create EwsClient instance

I tried to create EwsClient with the following two ways and got the same exception: "The HTTP request is unauthorized with client authentication scheme 'Digest'. The authentication header received from the server was 'Digest realm="ews@SxWBM",qop="auth",nonce="827DD2915ED2AF6BC10A82600FE90014",opaque="6CA079"'."

EwsClientAddress = http://localhost:8081/EcoStruxure/DataExchange;

1.

var client = MongooseObjectFactory.Current.GetInstance<IManagedEwsClient>();

var endpoint = new EwsConnection

{

     EwsEndpoint = EwsClientAddress,

     UserName = SBOConnectionSetting.UserName,

     Password = SBOConnectionSetting.Password

};

var resp = client.GetWebServiceInformation(endpoint);

2.

EwsServerDataAdapter.ConnectExisting(EwsServer.Name, EwsServer.UserName, EwsServer.Password);

EwsSecurity ClientSecurity = new EwsSecurity

{

     UserName = SBOConnectionSetting.UserName,

     Password = SBOConnectionSetting.Password

};

var clientObj = new EwsClient(ClientSecurity, EwsClientAddress);

It seems that in SmartConnector V2.2.108, the AuthenticationScheme in EwsSecurity is removed.

What should I do to prevent this exception happening?

Thanks!

Juh

Reply
  • All forum topics
  • Previous Topic
  • Next Topic
Replies 3
sesa145614_brid
Ensign sesa145614_brid Ensign
Ensign

Posted: ‎2017-02-25 07:51 AM

0 Likes
2
736
  • 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-02-25 07:51 AM

Hi,

I have found out the problem. The wrong password caused the exception.

Thanks!

Juh

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-27 06:12 AM

0 Likes
1
736
  • 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-02-27 06:12 AM

Juh,

I know you discovered the issue on your own, but I wanted to add a couple of comments.

  • AuthenticationScheme was removed as it is no longer appropriate to change the EWS authentication to anything other than HTTP Digest.
  • Besides supplying incorrect credentials, the error message you reported may also be symptomatic of a condition when SBO has exhausted it's available client connections.  This occurs when client code makes a connection and disposes of it frequently.  To alleviate this, SmartConnector 2.2, introduced a IManagedEwsClient which can be used without the need to instantiate the EwsClient class.  Rather, you call object factory to get an instance of the managed client.  See code snippet below.

                var creds = new EwsConnection

                {

                    EwsEndpoint = ServerAddress,

                    UserName = user.UserName,

                    Password = password

                };

                var client = MongooseObjectFactory.Current.GetInstance<IManagedEwsClient>();

                client.GetWebServiceInformation(creds);

Whether you use EwsClient or IManagedEwsClient is largely one of personal preference however if you frequently instantiate and dispose of your connection, the IManagedEwsClient would be the preferred approach

Reply
sesa145614_brid
Ensign sesa145614_brid Ensign
Ensign

Posted: ‎2017-02-27 06:22 AM

0 Likes
0
736
  • 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-02-27 06:22 AM

Thank you, Mark.

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