EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Send a raw soap message with TElHTTPSClient with WS-Security

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 06/27/2014 11:50:25
by Luis Arenal (Standard support level)
Joined: 05/10/2006
Posts: 9


I'm trying to add WS-Security for a raw text soap message, and then send it using TElHTTPSClient.

My message looks like the one below,

<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="TS-9AAB6387DAE13AC633140388350981678">
<wsse:UsernameToken wsu:Id="UsernameToken-9AAB6387DAE13AC633140388350729977">
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PWD</wsse:Password>



Then I get the following error from the server,

<faultcode xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</faultcode>
<faultstring xml:lang="en">An error occurred when verifying security for the message.</faultstring>


Newbie on Ws-Security used SoapUI to run some tests and found that credentials seemed to be right, the only difference was that SoapUI added a Nonce and a Create to the UsernameToken section when running the test.
It's not clear to me yet what value the Nonce should have, but they told me it is not needed.

Am I missing something from the client side?, some special TElHTTPSClient considerations for the connection maybe?
This is the first time facing WS-Security.

Any help will be appreciated,

Posted: 06/27/2014 12:09:11
by Dmytro Bogatskyy (EldoS Corp.)

Thank you for contacting us.

You can try to use TElXMLSOAPClient component (available in version 12) to create and send soap envelope. Please see XMLBlackbox\SOAPClient sample.

If you want to send a raw text soap message using TElHTTPSClient, you might need to set SOAPAction header, for example:
HTTPClient.RequestHeaders.Add('SOAPAction: ' + SOAPActionURL);
Posted: 04/29/2015 11:01:37
by Marcelo  (Standard support level)
Joined: 01/28/2014
Posts: 17

Could you please post and example to send a raw text soap message using TElHTTPSClient?

I try to use TElHTTPSClient.Post() function but it seems send another request between "connect" and the "post". Is correct?

Thanks, Marcelo
Posted: 04/29/2015 11:10:12
by Eugene Mayevski (EldoS Corp.)

What is "connect" in your question? Is it CONNECT HTTP command in the HTTP request? This command is sent when you use WebTunneling. Is it what you intend to do?

"Raw SOAP request" is a string which is sent with one call to Post() method, so there's really no sample needed other than "HTTPClient.Post(MyURL, MySOAPRequest)".

Sincerely yours
Eugene Mayevski



Topic viewed 2442 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!