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

SOAPUI Authentication

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
  • SOAPUI Authentication
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
Solved Go to Solution
Back to SmartConnector Forum
Solved
petri_greenwave
Lt. Commander | EcoXpert Master petri_greenwave Lt. Commander | EcoXpert Master
Lt. Commander | EcoXpert Master

Posted: ‎2017-04-12 05:02 AM

0 Likes
6
4943
  • 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-04-12 05:02 AM

SOAPUI Authentication

Good Day,

Following some successful tests using Swagger, I attempted to do further testing using the SOAPUI tool.

I saved the Swagger as an json file and imported this into SOAPUI. Reason being, the client will develop their own way of extracting the data from the SmartConnector but first they will also be using SOAPUI to do some testing.

Problem I have at the moment is I'm not sure how SOAPUI handles the Bearer token. Unfortunately there is not much detail in the EWS RESTFull Gateway manual when it comes to SOAPUI.

So the question is: after I added the username and password under the properties in SOAPUI, I get a failed to authenticate error. Assuming this is because the bearer token has not been retrieved, what other settings do I need to complete the authentication?

Tags (2)
  • Tags:
  • restfull
  • soapui
Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-04-12 06:29 AM . Last Modified: ‎2023-02-08 08:48 PM

4 Likes
4
4782
  • 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-04-12 06:29 AM

Petri,

Glad to hear you are making progress.  The Swagger metadata feed allows a large ecosystem of code generators to create clients stubs and proxys.  We provide a .NET sample which based on this.  You can find that in the samples repository in GitHub here: https://github.com/BuildingsLabs/SmartConnectorSamples.

 

As to your questions on how SoapUI needs to handle the Bearer token.  Well, it needs to handle it like any HTTP client would; it needs to include an Authorization header with the value 'Bearer <value of the token> which was obtained from the token endpoint.

 

Here's an example.  I'm using a slightly older version of SoapUI (v5.2.1) so my screen shots might be different.

 

  1. Create a "REST Project" with the URL of the base route e.g. http://localhost:8083.
  2. Obtain a token by issuing a "POST" to the token endpoint as shown here (/GetToken by default but that's configurable in your Endpoint Configuration in SmartConnector).

 

 

Note that the body contains the User Name and Password in the format:

grant_type=password&username=USERNAMEVALUE&password=PASSWORDVALUE

 

3. Grab the value of the Bearer Token from the response and add a Header value for another request.  I'm showing "Root" since it's the simplest.  The value of the header must be in the format Authorization = Bearer <TOKEN_VALUE> as shown here:

 

You can exercise any of the other actions similarly passing query and/or body parameters as needed but you'll always need to include the Authorization header.  Remember, the Token does expire so you'll need to get an updated value when it does.  You can adjust the token expiration in your Endpoint Configuration in SmartConnector but the maximum is 60 minutes.  Default is 5 minutes.

 

Also, don't forget to double URL encode all query parameters.  Body parameters don't need to be encoded like that but they do need to be in the proper format based on whatever your request format is.

See Answer In Context

Reply
Replies 6
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-04-12 06:29 AM . Last Modified: ‎2023-02-08 08:48 PM

4 Likes
4
4783
  • 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-04-12 06:29 AM

Petri,

Glad to hear you are making progress.  The Swagger metadata feed allows a large ecosystem of code generators to create clients stubs and proxys.  We provide a .NET sample which based on this.  You can find that in the samples repository in GitHub here: https://github.com/BuildingsLabs/SmartConnectorSamples.

 

As to your questions on how SoapUI needs to handle the Bearer token.  Well, it needs to handle it like any HTTP client would; it needs to include an Authorization header with the value 'Bearer <value of the token> which was obtained from the token endpoint.

 

Here's an example.  I'm using a slightly older version of SoapUI (v5.2.1) so my screen shots might be different.

 

  1. Create a "REST Project" with the URL of the base route e.g. http://localhost:8083.
  2. Obtain a token by issuing a "POST" to the token endpoint as shown here (/GetToken by default but that's configurable in your Endpoint Configuration in SmartConnector).

 

 

Note that the body contains the User Name and Password in the format:

grant_type=password&username=USERNAMEVALUE&password=PASSWORDVALUE

 

3. Grab the value of the Bearer Token from the response and add a Header value for another request.  I'm showing "Root" since it's the simplest.  The value of the header must be in the format Authorization = Bearer <TOKEN_VALUE> as shown here:

 

You can exercise any of the other actions similarly passing query and/or body parameters as needed but you'll always need to include the Authorization header.  Remember, the Token does expire so you'll need to get an updated value when it does.  You can adjust the token expiration in your Endpoint Configuration in SmartConnector but the maximum is 60 minutes.  Default is 5 minutes.

 

Also, don't forget to double URL encode all query parameters.  Body parameters don't need to be encoded like that but they do need to be in the proper format based on whatever your request format is.

Reply
petri_greenwave
Lt. Commander | EcoXpert Master petri_greenwave Lt. Commander | EcoXpert Master
Lt. Commander | EcoXpert Master

Posted: ‎2017-04-24 08:16 PM

1 Like
0
4782
  • 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-04-24 08:16 PM

Hi Mark,

Just want to say thank you for this reply, it really helped me figuring out SOAPUI.

I will give the examples a crack as well at some stage when I have some time.

Thanks again.

Reply
JessieSu
Lieutenant JessieSu Lieutenant
Lieutenant

Posted: ‎2017-05-04 03:25 AM

0 Likes
2
4782
  • 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-05-04 03:25 AM

​

Hi Mark,

I also met the SOAP UI problem, Follow the step above, I got a message: {"error": "unsupported_grant_type"}, and I attached the capture picture here. Do you know anything wrong? Thanks!

capture.png

In my project, I need share the SBO data to 3rd party company via EWS. I have installed SmartConnector, added and configured SOAP EWS Rest Provider, and also tested successfully in Swagger. I attempted to do further testing using the SOAPUI tool, but didn't succeed.

BRs / Jessie

Reply
JeffBowman
Sisko JeffBowman Sisko
Sisko

Posted: ‎2017-05-04 05:36 AM

0 Likes
0
4782
  • 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-05-04 05:36 AM

Hi Jie,

I don't see a request body in your request. What did you set for that?

It should look something like:


"grant_type=password&username=username&password=password"

Regards,

-Jeff

Reply
petri_greenwave
Lt. Commander | EcoXpert Master petri_greenwave Lt. Commander | EcoXpert Master
Lt. Commander | EcoXpert Master

Posted: ‎2017-05-04 05:36 AM

2 Likes
1
4782
  • 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-05-04 05:36 AM

Hi Jessie,

Copy and paste this into the yellow portion under Media Type:  grant_type=password&username=USERNAMEVALUE&password=PASSWORDVALUE 

Replace the "USERNAMEVALUE" and "PASSWORDVALUE" with the Admin account details of the ES you are requesting the data from.

Reply
JessieSu
Lieutenant JessieSu Lieutenant
Lieutenant

Posted: ‎2017-05-04 07:50 AM

1 Like
0
4782
  • 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-05-04 07:50 AM

Petri Faber​Jeffrey Bowman​

Hi Petri & Jeffrey,

Oh, Yes! Got it!

And I successfully tested it just now, Thank you very much!!

Best Regards / Jessie

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