Variables in included files
See original GitHub issueWhen I use an include file with <
the environment variables within are not processed.
I would like to call my authenticate.http
which returns a token from within another http file.
Working Example:
# @name authenticate
POST http://{{host}}:{{port}}/lagan/services/FLAuth HTTP/1.1
Content-Type: text/xml
SOAPAction: authenticate
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:flt="http://www.lagan.com/wsdl/FLTypes" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
<wsse:Security>
<wsse:UsernameToken xmlns:wsse='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' >
<wsse:Username>{{username}}</wsse:Username>
<wsse:Password Type='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'>
{{password}}
</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<authenticate xmlns=""/>
</soapenv:Body>
</soapenv:Envelope>
###
@binary-token = {{authenticate.response.body.//*[name()='wsse:BinarySecurityToken']}}
# @name retrieveCaseDetails
POST http://{{host}}:{{port}}/lagan/services/FL HTTP/1.1
Content-Type: text/xml
SOAPAction: retrieveCaseDetails
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:flt="http://www.lagan.com/wsdl/FLTypes" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
<wsse:Security>
<wsse:BinarySecurityToken>{{binary-token}}</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<flt:FWTCaseFullDetailsRequest>
<flt:CaseReference>BAE4LCM5-101002585690</flt:CaseReference>
<!--1 or more repetitions:-->
<Option>all</Option><!-- all, core, eforms-r, eforms-rw, events, form, fullform, notes, tasks, workflow, interactions, eform-data -->
</flt:FWTCaseFullDetailsRequest>
</soapenv:Body>
</soapenv:Envelope>
###
This works and grabs the {{binary-token}}
. But I’d like to put the authenticate into it’s own file for reuse with other .http
files.
Failing Example:
# @name authenticate
POST http://{{host}}:{{port}}/lagan/services/FLAuth HTTP/1.1
Content-Type: text/xml
SOAPAction: authenticate
< authenticate.http
@binary-token = {{authenticate.response.body.//*[name()='wsse:BinarySecurityToken']}}
# @name retrieveCaseDetails
POST http://{{host}}:{{port}}/lagan/services/FL HTTP/1.1
Content-Type: text/xml
SOAPAction: retrieveCaseDetails
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:flt="http://www.lagan.com/wsdl/FLTypes" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
<wsse:Security>
<wsse:BinarySecurityToken>{{binary-token}}</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<flt:FWTCaseFullDetailsRequest>
<flt:CaseReference>BAE4LCM5-101002585690</flt:CaseReference>
<!--1 or more repetitions:-->
<Option>all</Option><!-- all, core, eforms-r, eforms-rw, events, form, fullform, notes, tasks, workflow, interactions, eform-data -->
</flt:FWTCaseFullDetailsRequest>
</soapenv:Body>
</soapenv:Envelope>
###
But the {{username}}
and {{password}}
in authenticate.http
are treated as plain-text literals.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Passing a variable from one php include file to another
The parent file has access to variables in both included files. When including files in PHP, it acts like the code exists within...
Read more >Variables scope in included files - Dev Talk
"When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables...
Read more >include - Manual
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables...
Read more >Variables in #include files
Hi I writing a script, for organization, I want all ancillary variables in a different *.au3 file and all the main functions in...
Read more >Using Variables
Defining variables in included files and roles . You can define variables in reusable variables files and/or in reusable roles. When you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@warlord0 sorry, I misunderstand your case, and resolving variables in imported body file is not supported currently.
Thank for the reply.
Keep up the great work. Loving this extension. Made documentation and samples a breeze.