SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
I have a small visuale basic test app to sign in on an ES using the EwsClient. It works perfect with ES version 1.9.3 but when trying to connect to ES version 2.0.2 the server returns:
***
The HTTP request is unauthorized with client authentication scheme 'Digest'.
The authentication header received from the server was 'Digest realm="ews@SxWBM",qop="auth",algorithm="SHA-256",nonce="4459BFB53312E1CE4C0CDF0B6F7E5234",opaque="472A3A"'.
The remote server returned an error: (401) Unauthorized.
***
(also see attached debug log "2019-01-04.log")
The ES 2.0.2 EWS Server is enabled and credentials used (domain/user, password) has access via workstation sign in.
Class Code:
(also see attached VB Code file "EWSclass.txt")
The project refer to:
<packages>
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
<package id="Ews.Client" version="2.4.10" targetFramework="net461" />
<package id="Ews.Common" version="2.4.10" targetFramework="net461" />
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net461" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Owin" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.OwinSelfHost" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Hosting" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Security" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Security.Cookies" version="3.1.0" targetFramework="net461" />
<package id="Microsoft.Owin.Security.OAuth" version="3.1.0" targetFramework="net461" />
<package id="Mongoose.Common" version="2.4.10" targetFramework="net461" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
<package id="NLog" version="4.4.12" targetFramework="net461" />
<package id="Owin" version="1.0" targetFramework="net461" />
<package id="Swashbuckle.Core" version="5.6.0" targetFramework="net461" />
<package id="SxL.Common" version="2.4.10" targetFramework="net461" />
<package id="WebApiThrottle.StrongName" version="1.5.4" targetFramework="net461" />
</packages>
Am i missing something to configure?
Can anybody please help?
Link copied. Please paste this link to share this article on your social media post.
Hi!
In 2.0.X EWS is disabled by default. I would check to make sure that 'Enable EWS Server' in your EWS Server Configuration is set to Enabled:
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff
I have already done that.
My settings:
Regards
Rene
Link copied. Please paste this link to share this article on your social media post.
Hi Rene,
In my experience I have only seen this error when:
1. The credentials are actually incorrect (doesn't seem to be the case here)
2. The EWS Server is disabled (doesn't seem to be the case here)
3. So many requests have been sent without using the same session that you need to wait 5 minutes before sending more. In your case do any of your requests to 2.0 work or do none of them work?
Can you try a couple things?
1. Make sure 'Redirect web clients to https' is not checked.
2. If you arent already, can you try and use the HTTPS endpoint for EWS and see if it starts working.
From what I see in your code, you are doing everything you need to be.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff
1. These are my current Security settings:
2. I have tried HTTP and HTTPS endpoint (with fails) but I am able to log on from Workstation and Webstation with both HTTP and HTTPS.
It doesn't matter if I wait an hour with a retry.
Result of declaring New EwsClient conneting to 2.0.2 [ERROR]:
Result of declaring New EwsClient conneting to 1.9.3 [SUCCESS]:
Regards
Rene
Link copied. Please paste this link to share this article on your social media post.
Hi Rene,
As far as I know there should be no difference between 1.9.3 and 2.0.x as far as connecting via EWS (I have used the EWS Client from SmartConnector on both many many times with success)
Can you try and download SOAPUI and use it to try and send a GetWebServiceInformation request to your server? I would be interested to see if this works. If it does, I may need to get on a debug call with you for what you are doing.. If it doesn't work there either.. It is likely a problem with your EBO installation or configuration.. But at the moment I am not sure what would be the cause of that is the case.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff
I have installed SoapUI (Open Source version) and configured as below
I am completely NOOP in configuring HTTP REST request via API's so could you guide me on how to send a GetWebServiceInformation?
Regards
Rene
Link copied. Please paste this link to share this article on your social media post.
Hi Rene,
Please send me an email at jeff.bowman@se.com and I will help you set this up.
Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi
I have the same problem, I am trying to connect with a Smart connector to the EWS of EBO, I receive the same error.
Already checked the credentials, they are correct.
Have you solved the problem? How?
Thanks
Sabrina
Link copied. Please paste this link to share this article on your social media post.
Hi Sabrina,
One thing to verify is that the credentials you are using are using the default domain in EBO. In order to use EWS, the user must be in the default domain. Can you check if this is the case in your scenario?
Also, are you able to get it to work at all? There is also a known issue where it will seemingly work for a while, and then stop working.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Thanks Jeff,
I thought we were in the second scenario, as it worked for a while and then stopped.
it seems instead we solved unchecking the option "Redirect web clients to https" from the workstation.
I hope it will last...
Thanks
Best Regards
Sabrina
Link copied. Please paste this link to share this article on your social media post.
@JeffBowman is this the same issue I had with the missing StruxureMap files? I had a similar issue with a console app that i made, outside of the SmartConnector framework and had the same errors. It worked with EBO 1.9 but not 3.0. It was due to the fact that the EwsClient in the Nuget package actually has a dependency on the StructureMap and StructureMap.Net4 files which are found in the SmartConnector folder. There was one other file too but I don't recall which one. Adding a reference to these three files in my console app fixed my issue.
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.