Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using a tRestclient component which returns xml response. I am using tXMLMap to parse the xml. After defining the input structure i am gettting this issue. See below for my job. I am able to get response from rest client but tXMLMAP gives this error. Please see all screenshots below:
I'm assuming the data comes back as an XML String. If that is the case an easy way to solve this is to simply place a tConvertType component after your tRestClient component and convert the String to a Document. Then pass the String as a Document to your tXMLMap component. You could add a tMap after the tConvertType and simply move the String Document to output as the Body column if you want to keep it logical. This will be caused by the service you are calling and there is likely a way to force it to send back an XML document. However since I do not know or have access to your service, this is the easiest way of solving your issue 🙂
Place a tLogRow after your tRestClient and look at the data. Set the tLogRow to show the data "Vertical" mode. I suspect your data is coming back in the String column and not the Body column.
I'm assuming the data comes back as an XML String. If that is the case an easy way to solve this is to simply place a tConvertType component after your tRestClient component and convert the String to a Document. Then pass the String as a Document to your tXMLMap component. You could add a tMap after the tConvertType and simply move the String Document to output as the Body column if you want to keep it logical. This will be caused by the service you are calling and there is likely a way to force it to send back an XML document. However since I do not know or have access to your service, this is the easiest way of solving your issue 🙂
Did this resolve your issue?
Getting a response from tRestClient properly as shown below but facing the same "txmlMAp issue: java.lang.RuntimeException: row1.body can't be empty" Issue
Tried the string to document part but it didn't work.
Any other possible way of resolving this issue?
The solution that @rhall suggested should work using tConvertType. You may have something configured incorrectly.
See the output of my test job:
Starting job TestXmlBodyToMap at 21:15 13/06/2019. [statistics] connecting to socket on port 3807 [statistics] connected .----------------------------------------------------------------------------------------------------------------------------------------------------------. | #1. tLogRow_1 | +--------+-------------------------------------------------------------------------------------------------------------------------------------------------+ | key | value | +--------+-------------------------------------------------------------------------------------------------------------------------------------------------+ | string | <?xml version="1.0" encoding="UTF-8"?><people><person><id>1</id><name>Bob</name></person><person><id>2</id><name>Sally</name></person></people> | +--------+-------------------------------------------------------------------------------------------------------------------------------------------------+ .--------------. |#1. tLogRow_2 | +------+-------+ | key | value | +------+-------+ | id | 1 | | name | Bob | +------+-------+ .--------------. |#2. tLogRow_2 | +------+-------+ | key | value | +------+-------+ | id | 2 | | name | Sally | +------+-------+ [statistics] disconnected Job TestXmlBodyToMap ended at 21:15 13/06/2019. [exit code=0]
and the screenshot of the job showing the details of the tConvertType component:
I am also attaching the export of my test project in case you want to look at all the details.
Thank you so much for the Test Job. I found out the issue.
Appreciate your help.
Hi There,
I just need very quick help , which I am trying to fetch the records from rest getting an issue as below.
[statistics] connecting to socket on port 3487
[statistics] connected
Exception in component tXMLMap_1_TXMLMAP_OUT (Test_Job_1)
java.lang.RuntimeException: row3.string can't be empty
at bat_integration.test_job_1_0_1.Test_Job_1.tRESTClient_1Process(Test_Job_1.java:1923)
at bat_integration.test_job_1_0_1.Test_Job_1.runJobInTOS(Test_Job_1.java:2883)
at bat_integration.test_job_1_0_1.Test_Job_1.main(Test_Job_1.java:2709)
[FATAL]: bat_integration.test_job_1_0_1.Test_Job_1 - tXMLMap_1_TXMLMAP_OUT row3.string can't be empty
java.lang.RuntimeException: row3.string can't be empty
at bat_integration.test_job_1_0_1.Test_Job_1.tRESTClient_1Process(Test_Job_1.java:1923)
at bat_integration.test_job_1_0_1.Test_Job_1.runJobInTOS(Test_Job_1.java:2883)
at bat_integration.test_job_1_0_1.Test_Job_1.main(Test_Job_1.java:2709)
[statistics] disconnected
Job Test_Job_1 ended at 18:05 04/03/2020. [exit code=1]
Shree, could you share your solution?? I'm facing the very same issue as you were.