SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Posted: 2017-12-14 11:33 AM
Link copied. Please paste this link to share this article on your social media post.
I've setup a simple SmartConnector with a single SoapEWSRestProvider endpoint, and I've notices it won't respond to any hostname other than 127.0.0.1. (e.g. localhost doesn't work, ip address for the machine doesn't work, and hostname for the machine doesn't work)
I think this means I wouldn't be able to make requests to the endpoint unless the client is running on the same machine.
Additionally, I'm seeing HTTP Error 400. The request hostname is invalid. when I try to access the main page using my machine's hostname.
Is this some kind of license restriction, or am I misconfiguring something?
Link copied. Please paste this link to share this article on your social media post.
It seems you are attempting to tackle two issues at once. I recommend doing the following.
As for the Endpoint Configuration, v2.2 had a bug in it for using "+ notation" in configuring Endpoints. That will be fixed in v2.3. As for now, you will need to explicitly set your endpoint IP or DNS.
Sorry for the confusion.
Link copied. Please paste this link to share this article on your social media post.
Entering the config to be something other than an IP address requires either a host file addition, or a DNS entry. The same goes for "localhost".
We have tested host file remapping (using localhost and other names) as well as direct machine IP here in the lab so we know that does work.
There a no license restrictions of any type in this regard.
Link copied. Please paste this link to share this article on your social media post.
Hi Josh,
I have been doing something like here locally for a long time with no problems:
If you want to be able to hit the SoapEwsRestProvider endpoints from anywhere, you can simply add a '+' in the host field. But to access the swagger page, you will need to use something explicit (e.g. localhost or an explicit IP address) as the '+' notation isn't compatible with the swagger page for some reason.
As far as the hostname to access the main page, you should be able to change the 'Portal Address' setting under Setup > Service Settings. If you set it to for example 'http://+:8082' then you should be able to access this portal by using anything that resolves to this computer. (note: you may need to restart the SmartConnector service after changing this setting for it to take effect).
Regards,
-Jeff
Posted: 2017-12-15 07:18 AM
Link copied. Please paste this link to share this article on your social media post.
I had some success with your tips yesterday, but now seemingly I've got the configuration into a strange state.
I'm getting error messages when I go to the swagger documentation page, and so I tried to reset everything back to using 127.0.0.1. The only two properties I've changed are the Setup > Service Settings > Portal Address = 'http://127.0.0.1:8082'
and the REST endpoint's Host property = '127.0.0.1'
Restarting the service fixed it (after I had changed everything back to 127.0.0.1), but it seems like some of the changes did not propagate until the restart. (for example, the input on the swagger ui page and also on the endpoint list page were somehow remembering the old 'http://+:8083' address for the endpoint)
It's possible that some browser caching may have contributed to my confusion, but there is appears to also a problem with the back-end.
EDIT:
I recreated the problem by once again setting the host to '+' and the portal address to 'http://+:8082', and I'm getting the same problem after switching back to 127.0.0.1 (this time with caching disabled). It seems the server-side is remembering the http://+:8083 version of the url (at least for the swagger ui stuff).
It seems that the '+' feature does not work as it did in the prior version either, as I cannot use my computers hostname to access the swagger page anymore by using '+' in the host property.
Also, I had forgotten to mention that I've upgraded my Smart Connector to the latest stable version (unfortunately, I don't know which version I had prior (I believe it was 2.2.*), but the problems are occurring with version 2.2.130)
the error message in text form:
500 : {"Message":"An error has occurred.","ExceptionMessage":"Invalid URI: The hostname could not be parsed.","ExceptionType":"System.UriFormatException","StackTrace":" at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)\r\n at System.Uri..ctor(String uriString)\r\n at Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion)\r\n at Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at WebApiThrottle.ThrottlingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"} http://127.0.0.1:8083/swagger/docs/v1
Link copied. Please paste this link to share this article on your social media post.
It seems you are attempting to tackle two issues at once. I recommend doing the following.
As for the Endpoint Configuration, v2.2 had a bug in it for using "+ notation" in configuring Endpoints. That will be fixed in v2.3. As for now, you will need to explicitly set your endpoint IP or DNS.
Sorry for the confusion.
Posted: 2017-12-18 01:20 PM
Link copied. Please paste this link to share this article on your social media post.
I've upgraded to v2.3, and I'm still having a hostname related problem with the Soap/Rest endpoints.
It's not quite the same problem as before, (I've settled for using the machine hostname rather than localhost or 127.0.0.1, and the hostname works fine as the endpoint address).
My new problem is that I cannot seem to use the machine host name to refer to the ES (as a consequence, I could not get smart connector Soap/Rest endpoint to connect to an ES that's running on a different computer in the network, but I can connect to an ES running on the same computer so long as I use 127.0.0.1 as the host)
Link copied. Please paste this link to share this article on your social media post.
What is the value you are using? For SoapRestEwsProvider endpoints you need to enter the complete EWS endpoint. So for an SBO EWS Server, this would look like "http://SERVER:PORT/EcoStruxure/DataExchange". Is that the format you have entered?
Also, can you try connecting using a third party tool such as SoapUI or Fiddler using the same server address you are using in the SmartConnector configuration?
Does that work? If not, then you have a network or authentication issue not a SmartConnector issue.
Posted: 2017-12-19 07:06 AM
Link copied. Please paste this link to share this article on your social media post.
Oh, my apologies. I just realized I had a mistake in the spelling of EcoStruxure for the httpConfiguration>Server Address
I've been using the hostname just fine in one of my other endpoints without realizing it, so clearly it works just fine.
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.