Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84773members
354213posts

can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

SmartConnector Forum

Discussion of SmartConnector applications for integration of various other building management systems (BMS) into EcoStruxure Building Operation

Solved
jritchey_jaxcon
Lieutenant JG
Lieutenant JG
0 Likes
7
334

can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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?


Accepted Solutions
sesa180908_brid
Commander Commander
Commander
0 Likes
0
276

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

It seems you are attempting to tackle two issues at once.  I recommend doing the following.

  1. Delete all Endpoint Configuration.
  2. Change the Portal Address to what you want.  Which seems to be using the "+" notation.  (I recommend reading the Security Considerations Section of the SmartConnector Installation and Configuration Guide.pdf if you haven't already).
  3. Reboot the host machine.  Occasionally a port is left "in use".
  4. Verify the portal works.
  5. Debug using Log files as needed.

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. 

See Answer In Context

7 Replies 7
sesa180908_brid
Commander Commander
Commander
0 Likes
0
276

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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.

JeffBowman
Schneider Alumni (Retired)
Schneider Alumni (Retired)
0 Likes
2
276

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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

jritchey_jaxcon
Lieutenant JG
Lieutenant JG
0 Likes
1
276

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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

sesa180908_brid
Commander Commander
Commander
0 Likes
0
277

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

It seems you are attempting to tackle two issues at once.  I recommend doing the following.

  1. Delete all Endpoint Configuration.
  2. Change the Portal Address to what you want.  Which seems to be using the "+" notation.  (I recommend reading the Security Considerations Section of the SmartConnector Installation and Configuration Guide.pdf if you haven't already).
  3. Reboot the host machine.  Occasionally a port is left "in use".
  4. Verify the portal works.
  5. Debug using Log files as needed.

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. 

jritchey_jaxcon
Lieutenant JG
Lieutenant JG
0 Likes
2
276

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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)

sesa180908_brid
Commander Commander
Commander
0 Likes
1
276

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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.

jritchey_jaxcon
Lieutenant JG
Lieutenant JG

Re: can we have a hostname other than 127.0.0.1 for SoapEWSRestProvider?

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.