" /> Can we use HTTP headers in a SOAP Request? - Genesys CTI User Forum

Author Topic: Can we use HTTP headers in a SOAP Request?  (Read 2111 times)

This topic contains a post which is marked as Best Answer. Press here if you would like to see it.

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
Can we use HTTP headers in a SOAP Request?
« on: November 04, 2020, 04:28:51 PM »
Advertisement
Hello,

I have been building a web service object in IRD and wanted to check the following:
[list]
[li]We want to do a SOAP request, with http headers.  In the web service object we can select HTTP or SOAP, not a combination of both.  There is however a field in the SOAP request (SOAPAction field) which supposedly allows for 'optional HTTP Header Data' - according to the URS Reference Manual.  It does not provide any examples of how i can use http headers in the form of keys and values - if even this is what i can do to achieve my requirement.[/li]
[li]Can i use the HTTP tab for a SOAP request in some way.  Genesys TS say we can imitate a SOAP request in HTTP mode without saying how this can be achieved.[/li]
[/list]

Just wondered if anyone came across this and how they overcame it.
We are using URS and IRD 8.1.4.
Not even sure if Composer is able to this but we dont have it so wont be any use if possible.

thanks,

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Can we use HTTP headers in a SOAP Request?
« Reply #1 on: November 04, 2020, 07:09:56 PM »
Just do try and error...what could you lose?
Send a KVP in format a=1 as value and check with fiddler or wireshark what is sent.

Offline terry

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 35
Re: Can we use HTTP headers in a SOAP Request?
« Reply #2 on: November 06, 2020, 12:55:46 AM »
Unlikely first one (using SoapAction).
To use http for sending soap you probably will need in one or another way compose soap envelope in some string variable (for example as it is done in predefined macro RequestPrivateService_AOC) and use http post with this variable as payload.

Offline PFCCWA

  • Hero Member
  • *****
  • Posts: 655
  • Karma: -7
Re: Can we use HTTP headers in a SOAP Request?
« Reply #3 on: November 06, 2020, 10:57:33 AM »
[quote author=terry link=topic=11889.msg53510#msg53510 date=1604624146]
Unlikely first one (using SoapAction).
To use http for sending soap you probably will need in one or another way compose soap envelope in some string variable (for example as it is done in predefined macro RequestPrivateService_AOC) and use http post with this variable as payload.
[/quote]

thanks Terry, i can see the 'RequestPrivateService_AOC' but admit i dont understand how to use it for our purpose.
If it helps our SOAP request looks very simple and uses 1 variable (Var_ANI) in the SOAP body section.  This is a sample request provided by the web service provider (noting the Var_ANI will be a number (MSISDN) in the actual request):

<soapenv:Envelope
                  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:sub="http://soa.its.co.uk/itsdata_2">
                  <soapenv:Body>
                                    <sub:getITSProfile>
                                                      <!--type: msisdnType-->
                                                      <sub:ITSID>var_ANI</sub:ITSID>
                                    </sub:getITSProfile>
                  </soapenv:Body>
</soapenv:Envelope>



thanks,.

Marked as best answer by PFCCWA on November 15, 2020, 08:24:16 AM

Offline terry

  • Sr. Member
  • ****
  • Posts: 328
  • Karma: 35
Re: Can we use HTTP headers in a SOAP Request?
« Reply #4 on: November 06, 2020, 10:23:24 PM »
Probably something like assigning template of your request (request where all variables replaced with ~s) to some variable and after that use StrFormat function to substitute variables values and get actual request.

ASSIGN template = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sub="http://soa.its.co.uk/itsdata_2">
              <soapenv:Body> <sub:getITSProfile> <!--type: msisdnType--> <sub:ITSID>~s</sub:ITSID></sub:getITSProfile></soapenv:Body></soapenv:Envelope>'
ASSIGN request =  StrFormat[template, var_ANI]

and use this request as payload of POST web request.