Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a thttpClient which i use to request a SOAP service.
In this component I have a Request Body formated as Text with the necessary escape characters:
"<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">
<soap12:Body>
<GetTransactions xmlns=\"http://24sevenoffice.com/webservices/economy/accounting/\">
<searchParams>
<DateSearchParameters>EntryDate</DateSearchParameters>
<ShowOpenEntries>1</ShowOpenEntries>
<DateStart>2025-01-01</DateStart>
<DateEnd>2025-01-02</DateEnd>
<TransactionTypeId>15</TransactionTypeId>
</searchParams>
</GetTransactions>
</soap12:Body>
</soap12:Envelope>"
This request works, but i would like to use context variables in the elements/tags DateStart and DateEnd.
I have set the variables in a tJavaRow component formated as string, but I have trouble to set the variables into the XML?
Do any of you experts out there know how to do this?
See an example here :
Hi Denis_Segard, its not possible to see in the picture you attached, its to grainy if I zoome in... Please post a new picture or write the code to use....
Hello,
Code used in "Body" content :
"<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">
<soap12:Body>
<GetTransactions xmlns=\"http://24sevenoffice.com/webservices/economy/accounting/\">
<searchParams>
<DateSearchParameters>EntryDate</DateSearchParameters>
<ShowOpenEntries>1</ShowOpenEntries>
<DateStart>"+context.DateStart+"</DateStart>
<DateEnd>"+context.DateEnd+"</DateEnd>
<TransactionTypeId>15</TransactionTypeId>
</searchParams>
</GetTransactions>
</soap12:Body>
</soap12:Envelope>"
Kind regards
Denis
Hi Denis_Segard
I have tried this code before, but then i get an error.
On the other hand if I use escape character in this code like:
<DateStart>\"+context.DateStart+\"</DateStart>
<DateEnd>\"+context.DateEnd+\"</DateEnd>
I do not get an error, but also no result. Somhow the dates are then not red propper dates...
I have found a workaround and create the whole xml part in tjava, put it in an context variable and use this variable in the Request body, but would still like to hav a solution where i could only insert the dates as context variables in the XML...